Creating the QuickReservationServlet Servlet

You will now add another Web resource, a servlet named QuickReservationServlet, to the Web project.

The servlet is need to handle requests sent from the JSP; to process them; to call the appropriate business methods from the session bean QuickOrderProcessorBeans; and finally to format the data records for display in the JSP.


The structure of the Web project QuickCarRentalWeb is currently displayed in the J2EE Explorer.



       1.      In the J2EE Explorer, to open the relevant wizard, choose New ® Servlet… from the context menu of the project node QuickCarRentalWeb.

       2.      In Servlet Name, enter QuickReservationServlet.

       3.      Choose the servlet type HTTP Servlet.

       4.      Assign the package as the Servlet Package.

       5.      Activate the checkboxes for the two servlet methods doGet() and doPost().

       6.      Choose Finish.


The wizard creates the servlet file QuickReservationServlet along with the two methods doGet()and doPost().

Next step:

Adding Source Code to the Servlet