-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------
Can't you just increase the session timeout value to a large value? Say
12 hours?
Or (depending on what you are doing), change req.getSession(false) to
req.getSession(true) to allow creation of a new session if one does not
exist? If you must have 'false', you should probably have an error
check, too, just in case...
John
Morten Primdahl wrote:
> -----------------------------
> Please read the FAQ!
> <http://java.apache.org/faq/>
> -----------------------------
>
> Mjallo.
>
> After migrating from JServ 0.9.12 to 1.0, I've experienced my
> HttpSession timing out, resulting in a 'Document contained no data'
> (NullPointerException) the first time I hit a link where the session
> object is needed (after having left the machin alone for a while).
>
> The NPE is thrown as I try to get a variable in the session object,
> like:
>
> HttpSession ses = req.getSession(false);
> String str = (String)ses.getValue("val");
>
> If I hit the link that leads to the code immediately afterwards,
> everything seems to be fine.
>
> Is there a way to disable session timeout? I only need sessions to
> timeout when the browser is shut down. I saw in the example file
> that default timeout was 30 mins, and that
>
> # Syntax: session.timeout=(long)>0
>
> So I guess 0 isn't giving me eternal sessions. Anyone?
>
> Thanks
>
> Morten
>
> --
> Morten Primdahl Caput ApS Tel +45 33 12 24 42
> [EMAIL PROTECTED] Nygade 6 Fax +45 33 91 24 42
> http://www.caput.com DK-1164 Kbh K
>
> --
> --------------------------------------------------------------
> Please read the FAQ! <http://java.apache.org/faq/>
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Archives and Other: <http://java.apache.org/main/mail.html/>
> Problems?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]