Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP INCLUDE TO SERVLET

 
Graham Mead
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops directory structure is
...default_app/servlets/zcaz/LittleServlet
...default_app/web/FormJSP.jsp
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic