Our application has two servlets: IndexServlet
, which is a trivial example of forwarding any request, mapped with "/" to index.jsp
and FlightServlet
, which processes the request using the functionality we developed in the previous chapters and forwards the response to response.jsp
. Here in, we simply declare the FlightEngine
and SearchRequest
as the class attributes and annotate them with @Inject
. FlightSearchFilter
is a filter with the only responsibility of validating the request parameters. Index.jsp
is the landing page of this application and presents the user with a form to search the flights, and response.jsp
is the results page.
The flight search form will look as shown in the following screenshot:
The search page would subsequently lead to the following result page.
In order to build the application, we need to execute the following command in the directory chapter_4/flightsweb
, where the pom.xml
file for the project resides:
shell> mvn clean package...