Hi ..
I am trying to pass control from a servlet to a jsp, using request
dispatcher using the code,
RequestDispatcher rd = null;
rd = request.getRequestDispatcher("/admin-gui/PolicyMenu.jsp");
rd.forward(request,response);
but when i run the code, i get an error like,
message /servlet/admin-gui/PolicyMenu.jsp
description The requested resource (/servlet/admin-gui/PolicyMenu.jsp)
is not available.
i am using Tomcat 5.5.9. My jsp pages are stored in,
c:\Tomcat 5.5\webapps\admin-gui
and the servlet class is stored in,
c:\Tomcat 5.5\webapps\admin-gui\WEB-INF\classes
please help me soon...
regards
sara
> i am using Tomcat 5.5.9. My jsp pages are stored in,
>
> c:\Tomcat 5.5\webapps\admin-gui
> RequestDispatcher rd = null;
> rd = request.getRequestDispatcher("/admin-gui/PolicyMenu.jsp");
The first problem I see is this. The parameter to getRequestDispatcher
is a context-relative URI. You don't seem to be passing a context-
relative URI. Since "admin-gui" is part of the context path, it should
be omitted, like this:
RequestDispatcher rd = null;
rd = request.getRequestDispatcher("/PolicyMenu.jsp");

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
sarath - 08 Jun 2005 06:56 GMT
thanks for your advice..i followed your advice and it worked and
reached that jsp page, but when i click some links from there, it is
not going to any page and gives me errors....
the page flow was like,
submit Link submit
login.jsp------>PolicyMenu.jsp----> other.jsp--->servlet the back
to PolicyMenu.jsp through request despatcher..and when i am trying to
go to the other.jsp, i get the error that,
The requested resource (/servlet/other.jsp) is not available. while it
was working perfectly earlier when i came through the login page...
my workspace is like,
/webapp/admin-gui/ -->contains jsp files (PolicyMenu.jsp and
other.jsp)
/webapps/admin-gui/WEB-INF/classes --> contains the servlet from which
i am get request from other.jsp and i am trying to dispatch to
PolicyMenu.jsp.
please help ...if you require any more details, ask me....
its been almost 2 days i am stuck with this...
regards
sarath
sarath - 08 Jun 2005 11:00 GMT
i also have a doubt whether i should set some value in the web.xml or
some other xml file so that the application context is the place where
i have put my jsp files
> > i am using Tomcat 5.5.9. My jsp pages are stored in,
> >
[quoted text clipped - 17 lines]
> Chris Smith - Lead Software Developer/Technical Trainer
> MindIQ Corporation