tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Lawlor" <>
Subject Please explain this Context
Date Mon, 25 Jun 2001 14:35:33 GMT
I have a login.jsp in my application in the path security/login/login.jsp
and certain URLs are protected with a security constraint.  However,
I expect users to go to a certain URL in order to log in.  If they don't,
I need to have them first fill in a form.  So, in login.jsp I have a tag
does the check and if they need to fill in the form I redirect to the form:

  rd = sc.getRequestDispatcher("/MyForm.jsp");
  rd.forward(request, response);

Once they fill in the form and submit the processing servlet forwards the
request to the proper target URL:

  rd = sc.getRequestDispatcher("/" + project);
  rd.forward(request, response);

The Question:

The first part of this works just fine.  It gets to MyForm.jsp and does
its thing, but when I forward to /project it fails.  The dispatcher trace
shows that it is trying to find <context>/security/login/project rather
than <context>/project.

After passing thru a couple of servlets, why is now insisting on adding
security/login to the path?

I have worked around the problem by just doing a sendRedirect, but
the above behavior confuses me and seems to contradict the spec.

Frank Lawlor
Athens Group, Inc.
(512) 345-0600 x151
Athens Group, an employee-owned consulting firm integrating technology
strategy and software solutions.

View raw message