Thank you for your reply Konstantin.

> In short:
> 1. When session cookie is created in recent versions of Tomcat,  the
> Path parameter in it is set to   webappName + "/".
>
> 2. Requests to "webappName" are usually automatically redirected to
> "webappName + /" (Tomcat sends response code 302),
>
> but in some rare configurations this redirect does not happen.
> I do not remember what exactly are the circumstances, but I think that
> this involved a servlet that is mapped to "/*", and maybe absence of a
> welcome page.

Sorry I'm a little lost here, but is there anything I can do to avoid
having to force Tomcat to do this redirect? I tried this in three
different ways with the same result.
1. I tried placing a welcome page at the webappName level.
2. I also tried placing a welcome page inside the jsp folder
3. Lastly I tried calling a Servlet directly bypassing any jsp page first.

When the url-pattern is /jsp/* - then request.getRemoteUser() is null,
but I'm able to use the session normally. Inspecting
request.getRemoteUser() in the welcome page shows that it is in fact
set, but apparently for that page only.
When the url-pattern is /* - then request.getRemoteUser() is set
notmallyl, but I'm unable to use the session.

>
>
> If your servlet reacts to request to "webappName", then the
> sessionCookie with Path of "webappName + "/"" woundn't be sent by
> browser when it repeats the request.

Sorry I didn't understand what this meant. :(

>
> It should be possible to explicitly configure the Path attribute of
> the session cookie using cookie-config element in web.xml.  See
> cookie-configType in
> http://java.sun.com/xml/ns/javaee/web-common_3_0.xsd

I looked through the document and found the cookie-config spec, but am
not sure which parameter you are suggesting that I set and to which
value. Sorry about that.

When my welcome page is inside the jsp folder it has the following syntax:
response.sendRedirect("/webappName/myServletName"); %>
However when it is in the webappName directory I simply do
response.sendRedirect("myServletName"); %>

Lastly I upgraded from Tomcat 7.0.19 to 7.0.21 thinking maybe that
would fix it. :)

Thank you very much.
Rudy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to