tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Algesten" <>
Subject RE: Servlet Spec interpretation FORM-based authentication
Date Tue, 12 Nov 2002 09:43:53 GMT
This seems another aspect of issue ... there are
some work in progress on that one. There's even a patch, check it out.


-----Original Message-----
From: Algirdas P. Veitas [] 
Sent: 12 November 2002 04:57
Subject: Servlet Spec interpretation FORM-based authentication


I am running into an issue with FORM-based authentication
using 4.1.12 (and 4.0.4).  It seems as if the implementation
is not in line with the 2.3 Servlet Specification.  Specifically, the
Servlet Spec states:

SRV.12.5.3 Form Base Authentication
J2EE. Login Form Notes
"If the form based login is invoked because of an HTTP request, the
request parameters must be preserved by the container for use if, on 
successful authentication, it redirects the call to the requested

It seems as if the request parameters are not being preserved by the 
container.  After a successful login the container forwards me to the
URL (a JSP page).  The JSP page executes the following code:

Enumeration params = request.getParameterNames();
while (params.hasMoreElements())
 String paramKey = (String)params.nextElement();
 String paramVal = request.getParameter(paramKey);
System.out.println(paramKey + " = " + paramKey); }

which I would expect to atleast see printed out:

j_username = <some val>
j_password = <some val 2>

but in fact these request parameters are not printed out and thus not
part of 
the request.

A bit of digging in the source revealed that in the method


of class org.apache.catalina.authenticator.FormAuthenticator, the code
executing HttpResponse.sendRedirect(String url) in order to forward the
to the appropriate page.  A sendRedirect() will wipe out all of the
request parameters.

I think in order to preserve the parameters the sendRedirect() needs to
replaced by HttpRequest.getServletDispatcher().forward().

Has anyone else seen this behavior and is my claim valid?


Open WebMail Project (

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message