You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lior Shliechkorn <li...@yahoo.com> on 2003/01/28 17:37:56 UTC

Servlet Context Problem

Hello,

I'm having problems with the ServletContext object. When I acquire the context, it just gets the "path" to my webApp, right? The servlet will then know what webApp it's under. Ok, so I tried to make it work with a servlet to forward to another page.

Now the servlet is mapped as /webApp/servlet/ServletLogin - And I want the servlet to forward control to a JSP page. But the problem that I'm encountering is that when it forwards to the JSP page, it looks for it under the servlet/jsp/Page.jsp...and not just jsp/Page.jsp. I have the code I used below. Any help is grealy appreciated.

ServletContext context = getServletContext();
String url = "/jsp/JSPpage.jsp";
RequestDispatcher rd = context.getRequestDispatcher(url);
rd.forward(request, response);

Lior




---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now