When you have links in your second servlet, do you use
response.encodeURL(link) on them? If you don't, you will lose
the session the same way as you do if you don't use the
response.encodeRedirectUrl() in redirecting.. That is, depending
on your server and client configurations..

On Fri, 1 Aug 2003, Munteanu Gabriel wrote:

> Hi,
>
> It's about sessions who "disappear" from one servlet to another.
> I know that this has been discussed, but from what I have read
> there was no good solution to this problem.
> Here it goes:
> I have apache 1.3.27 + mod_jk2 + tomcat 4.1.24. - on linux
> I have one tomcat process runninng, one application, one context.
>
> I have a servlet that in his doGet method works a little on the parameters
> and then
> response.sendredirect [ or dispatcher.forward - in this situation both have
> the same effects] to another servlet.
> I set some attributes in the first servlet and they disappear in the second
> servlet - in fact the session is null
> [I use request.getSession(false)].
>
> After I read many messages on this subject, I tried to use
> response.sendredirect(response.encodeRedirectURL(myservlet))
> and it worked. BUT, in this second servlet I have other links to other
> servlets. When I clicked on them, in the next servlets the session was gone
> again.
>
> Another trial was that I put it all on another linux, to a friend on my LAN.
> He has apache 2.0.4x + mod_jk2 + tomcat 4.1.24.
> It worked perfectly. - Also I noticed there was no need for
> encodeRedirectURL
>
> Then I installed tomcat 4.1.18 on my original linux, and also it worked in
> the combination
> I have apache 1.3.27 + mod_jk2 + tomcat 4.1.18. - on linux
>
> So, I am sure that NO SERVLET OF MINE was to blame but the configurations of
> the servers.
>
> Can anybody tell me what configuration directive can be to blame for such
> problems [in all the servers Apache, Linux, ...] ?
>
> At what directives should I look in httpd.conf and server.xml?
>
> Thank you in advance
> Gabi
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to