Markus,

>> I try to create a redirect to a page with a session-id if there is
>> no session. Seems to be easy, but in combination with apache/mod_jk
>> my servlet redirects unlimited because it doesn't recognizes the
>> created session.
>> 
>> Btw: Cookies are disabled, this is important.

It looks like you are not handling the situation where the user has
requested a session with an ID but the session does not exist. I don't
think that Tomcat will create a session for you unless you ask.
Somewhere, you'll need to actually generate the session id using a call
to request.getSession(true). Otherwise, the encodeRedirectURL method
will not have a session id to add.

If the session is mandatory, I recommend changing:

    request.getSession(false)
to
    request.getSession(true)

This will create a session if one does not exist.

The logic in the method to determine if a redirect is necessary seems
... overly complex? Maybe a little cleanup would help.

-chris

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to