On Tue, 4 Dec 2001, Sobeck, James (ISS Atlanta) wrote:

> Date: Tue, 4 Dec 2001 14:35:00 -0500
> From: "Sobeck, James (ISS Atlanta)" <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: 'Tomcat Users List' <[EMAIL PROTECTED]>
> Subject: RE: Need help on Session's null pointer exception
>
> I think i got that error once when i tried to put a null Object into
> session. do something like
>
> if (Object != null){
>       session.putValue("key", Object);
> }
>

You should also note that in a Servlet 2.3 environment, calling:

  session.setAttribute("key", null);

is semantically equivalent to calling:

  session.removeAttribute("key");

The bottom line is that it's not legal to store null attributes -- and
this applies to request, session, and ServletContext attributes equally.

> -hope that helps,
>
> Jimmy

Craig


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to