tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: HttpServletRequest#getSession(false) says the session is good, but session is still invalid!
Date Fri, 12 Dec 2008 19:40:18 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin,

Martin B. Smith wrote:
> Actually, looking at it in the pastebin -- could it be that I'm setting
> an attribute FOR the error about a missing session?
> 
> Hmm.... did I just solve my own problem?

Yup! Look at your "error handling" code:

>                 if(!request.isRequestedSessionIdValid() || request.getSession(false)
== null)
>                 {
>                         request.setAttribute(WebUIConstants.ERROR_MESSAGE_DETAIL, "Your
session has timed out. Please login again.");
>                         return mapping.findForward(WebUIConstants.ACTION_DETAILED_FAILURE);
>                 }


That just ain't gonna work. I think you want to set an attribute in the
request, not the session.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAklCviIACgkQ9CaO5/Lv0PCRJQCfQWZmh2E07VZ1IJWMKLvpbWXe
AMgAniWWNM83MZkSRmFcnXvzVHO5OKKZ
=g8dw
-----END PGP SIGNATURE-----

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


Mime
View raw message