Skip to Content
0
Former Member
Jul 23, 2004 at 11:13 AM

example J2EE_QuickCarRental: not forwarding to a jsp

21 Views

Hello,

i cannot make a forward to the jsp file; always the path will be "QuickCarRental/servlet/quickCarRentalView.jsp" at the server.

My web.xml-file:

<web-app>

<display-name>Rent-A-Car</display-name>

<description>Web resources for Car Rental example</description>

<servlet>

<servlet-name>quickCarRentalView.jsp</servlet-name>

<jsp-file>/quickCarRentalView.jsp</jsp-file>

</servlet>

<servlet>

<servlet-name>QuickReservationServlet</servlet-name>

<servlet-class>com.sap.examples.quickcarrental.servlet.QuickReservationServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>quickCarRentalView.jsp</servlet-name>

<url-pattern>/view</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>QuickReservationServlet</servlet-name>

<url-pattern>/</url-pattern>

</servlet-mapping>

<ejb-local-ref>

<ejb-ref-name>ejb/QuickOrderProcessorBean</ejb-ref-name>

<ejb-ref-type>Session</ejb-ref-type>

<local-home>com.sap.examples.quickcarrental.QuickOrderProcessorLocalHome</local-home>

<local>com.sap.examples.quickcarrental.QuickOrderProcessorLocal</local>

<ejb-link>QuickCarRentalEjb.jar#QuickOrderProcessorBean</ejb-link>

</ejb-local-ref>

</web-app>

code in servlet:

RequestDispatcher dispatcher = request.getRequestDispatcher("/view");

message from server:

Application error occurred during the request procession.

Details: javax.servlet.ServletException: Requested resource ( QuickCarRental/servlet/quickCarRentalView.jsp ) not found.

at com.sap.examples.quickcarrental.servlet.QuickReservationServlet.doWork(QuickReservationServlet.java:63)

After deployment on server the jsp-file will be in the root-folder.

Thanks,

Frank