Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 13 additions & 17 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v9.0">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre1.8.0_241">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="build/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v9.0">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
2 changes: 1 addition & 1 deletion build/classes/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/controller/
/model/
/services/
/controller/
Binary file modified build/classes/controller/BusController.class
Binary file not shown.
Binary file modified build/classes/controller/FlightController.class
Binary file not shown.
Binary file modified build/classes/controller/HotelController.class
Binary file not shown.
Binary file modified build/classes/controller/TrainController.class
Binary file not shown.
9 changes: 6 additions & 3 deletions src/controller/BusController.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.Bus;
import services.FareCalculator;

@WebServlet(urlPatterns= {"/bus"})
public class BusController extends HttpServlet {
private static final long serialVersionUID = 1L;
Expand All @@ -28,9 +31,9 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t


protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
/*


int numberOfPersons=Integer.parseInt(request.getParameter("persons"));
int numberOfPersons=Integer.parseInt(request.getParameter("persons"));
String bustype=request.getParameter("bustype");
String date=request.getParameter("start");
System.out.println(numberOfPersons);
Expand Down Expand Up @@ -72,6 +75,6 @@ else if(bustype.equals("nonacsemisleeper")) {
request.setAttribute("busfare", rate);
RequestDispatcher dispatcher = request.getRequestDispatcher("/WEB-INF/views/busView.jsp");
dispatcher.forward(request, response);
*/ }
}

}
7 changes: 5 additions & 2 deletions src/controller/FlightController.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.Flight;
import services.FareCalculator;



@WebServlet("/flight")
Expand All @@ -29,7 +32,7 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t
}

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
/* int numberOfPersons=Integer.parseInt(request.getParameter("persons"));
int numberOfPersons=Integer.parseInt(request.getParameter("persons"));
String classtype=request.getParameter("class");
String from=request.getParameter("from");
String to=request.getParameter("to");
Expand Down Expand Up @@ -59,6 +62,6 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
request.setAttribute("flightfare", rate);
RequestDispatcher dispatcher = request.getRequestDispatcher("/WEB-INF/views/flightView.jsp");
dispatcher.forward(request, response);
*/}
}

}
7 changes: 5 additions & 2 deletions src/controller/HotelController.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.Hotel;
import services.FareCalculator;



/*import model.Hotel;
Expand All @@ -33,7 +36,7 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t
}

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
/* int numberOfPersons=Integer.parseInt(request.getParameter("persons"));
int numberOfPersons=Integer.parseInt(request.getParameter("persons"));
String roomtype=request.getParameter("roomtype");
String occupancy=request.getParameter("occupancy");
String from=request.getParameter("from");
Expand Down Expand Up @@ -67,6 +70,6 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
RequestDispatcher dispatcher = request.getRequestDispatcher("/WEB-INF/views/hotelOutputView.jsp");
dispatcher.forward(request, response);

*/ }
}

}
7 changes: 5 additions & 2 deletions src/controller/TrainController.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.Train;
import services.FareCalculator;


/**
* Servlet implementation class TrainController
Expand All @@ -31,7 +34,7 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) t


protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
/* int numberOfPersons=Integer.parseInt(request.getParameter("persons"));
int numberOfPersons=Integer.parseInt(request.getParameter("persons"));
String berth=request.getParameter("berth");
String date=request.getParameter("to");
System.out.println(numberOfPersons);
Expand Down Expand Up @@ -68,6 +71,6 @@ else if(berth.equals("nonac")) {
request.setAttribute("trainfare", trainfare);
RequestDispatcher dispatcher = request.getRequestDispatcher("/WEB-INF/views/trainView.jsp");
dispatcher.forward(request, response);
*/}
}

}
45 changes: 45 additions & 0 deletions src/model/Bus.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
package model;

import java.time.LocalDate;

// Type your code

public class Bus{

private int noOfPersons;
private String busType;
private int rates;
private LocalDate date;
public Bus(int noOfPersons, int rates, String busType, LocalDate date) {
super();
this.noOfPersons = noOfPersons;
this.busType = busType;
this.rates = rates;
this.date = date;
}
public int getNoOfPersons() {
return noOfPersons;
}
public void setNoOfPersons(int noOfPersons) {
this.noOfPersons = noOfPersons;
}
public String getBusType() {
return busType;
}
public void setBusType(String busType) {
this.busType = busType;
}
public int getRates() {
return rates;
}
public void setRates(int rates) {
this.rates = rates;
}
public LocalDate getDate() {
return date;
}
public void setDate(LocalDate date) {
this.date = date;
}




}
65 changes: 65 additions & 0 deletions src/model/Flight.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,68 @@
package model;

import java.time.LocalDate;

public class Flight{

private int noOfPersons;
private String classType;
private int rates;
private LocalDate from;
private LocalDate to;
private String triptype;
public int getNoOfPersons() {
return noOfPersons;
}
public void setNoOfPersons(int noOfPersons) {
this.noOfPersons = noOfPersons;
}
public String getClassType() {
return classType;
}
public void setClassType(String classType) {
this.classType = classType;
}
public int getRates() {
return rates;
}
public void setRates(int rates) {
this.rates = rates;
}
public LocalDate getFrom() {
return from;
}
public void setFrom(LocalDate from) {
this.from = from;
}
public LocalDate getTo() {
return to;
}
public void setTo(LocalDate to) {
this.to = to;
}
public String getTriptype() {
return triptype;
}
public void setTriptype(String triptype) {
this.triptype = triptype;
}
public Flight(int noOfPersons, int rates, String classType, LocalDate from, LocalDate to, String triptype) {
super();
this.noOfPersons = noOfPersons;
this.classType = classType;
this.rates = rates;
this.from = from;
this.to = to;
this.triptype = triptype;
}



}






//Type your code
67 changes: 66 additions & 1 deletion src/model/Hotel.java
Original file line number Diff line number Diff line change
@@ -1,2 +1,67 @@
package model;
// Type your code

import java.time.LocalDate;

public class Hotel{

private int noOfPersons;
private String roomType;
private int rates;
private String occupancy;
private LocalDate fromdate;
private LocalDate todate;


public Hotel(int noOfPersons, String roomType, int rates, String occupancy, LocalDate fromdate, LocalDate todate) {
super();
this.noOfPersons = noOfPersons;
this.roomType = roomType;
this.rates = rates;
this.occupancy = occupancy;
this.fromdate = fromdate;
this.todate = todate;
}
public int getNoOfPersons() {
return noOfPersons;
}
public void setNoOfPersons(int noOfPersons) {
this.noOfPersons = noOfPersons;
}
public String getRoomType() {
return roomType;
}
public void setRoomType(String roomType) {
this.roomType = roomType;
}
public int getRates() {
return rates;
}
public void setRates(int rates) {
this.rates = rates;
}
public String getOccupancy() {
return occupancy;
}
public void setOccupancy(String occupancy) {
this.occupancy = occupancy;
}
public LocalDate getFromdate() {
return fromdate;
}
public void setFromdate(LocalDate fromdate) {
this.fromdate = fromdate;
}
public LocalDate getTodate() {
return todate;
}
public void setTodate(LocalDate todate) {
this.todate = todate;
}







}
47 changes: 46 additions & 1 deletion src/model/Train.java
Original file line number Diff line number Diff line change
@@ -1,2 +1,47 @@
package model;
// Type your code

import java.time.LocalDate;


public class Train{

private int noOfPersons;
private String berth;
private int rates;
private LocalDate date;
public Train(int noOfPersons, int rates, String berth, LocalDate date) {
super();
this.noOfPersons = noOfPersons;
this.berth = berth;
this.rates = rates;
this.date = date;
}
public int getNoOfPersons() {
return noOfPersons;
}
public void setNoOfPersons(int noOfPersons) {
this.noOfPersons = noOfPersons;
}
public String getBerth() {
return berth;
}
public void setBerth(String berth) {
this.berth = berth;
}
public int getRates() {
return rates;
}
public void setRates(int rates) {
this.rates = rates;
}
public LocalDate getDate() {
return date;
}
public void setDate(LocalDate date) {
this.date = date;
}




}
Loading