aspose file tools*
The moose likes Servlets and the fly likes JSP INCLUDE TO SERVLET Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP INCLUDE TO SERVLET" Watch "JSP INCLUDE TO SERVLET" New topic
Author

JSP INCLUDE TO SERVLET

Graham Mead
Ranch Hand

Joined: Sep 28, 2001
Posts: 57
Hi,
We are attempting to include a Servlet from a jsp with the jsp:include action running withing the Visualage Websphere test environment. Our directory structure is
...default_app
servlets
zcaz
LittleServlet
web
FormJSP.jsp
The include statement in FormJSP.jsp is
<jsp:include page="/zcaz.LittleServlet" flush="true"/>
LittleServlet is in the package zcaz. When we invoke the jsp everything works except the include which gives a Error 404 file not found on the LittleServlet. We've read that the relative URL on the include is relative to the Web application to which the jsp belongs and that the base URL can be found using the JSP's ServletContext object.
How is this done and could anyone help in what the relative URL should be with this configuration
TIA Graham

Graham Mead
Ranch Hand

Joined: Sep 28, 2001
Posts: 57
Oops directory structure is
...default_app/servlets/zcaz/LittleServlet
...default_app/web/FormJSP.jsp
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
i haven't worked with websphere, but based on my knowledge of servlets, here are my thoughts:
did you define the servlet and servlet-mapping elements appropriately in your web.xml file? something like this..Then, in FormJSP.jsp, try "<jsp:include page="/LittleServlet" flush="true"/>"
Good luck.

------------------
Miftah Khan
- Sun Certified Programmer for the Java� 2 Platform
- Sun Certified Web Component Developer for the Java� 2 Platform, Enterprise Edition
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP INCLUDE TO SERVLET