getAttribute « Session « Java Enterprise Q&A

1. Can I use session.getAttribute() in sessionDestroyed

It seems that I can't.I got NullPointerException.If no,How can I getAttribute BEFORE sessionDestroyed when it is going to be dstroyed?

2. Doubt about getAttribute of Session

For security it's not recommended to do things like that, and indeed servers can have it disabled. If you MUST communicate with another webapp, you might want to do so either via HTTP requests back and forth or through some custom network protocol (this also will enable you to keep your scheme working if one or the other webapp moves to ...

3. session.getAttribute

One possibility is that your servlet code is not checking for an existing session but always creates a new one. Another possibility is that the applet does not properly use the session ID c o o k i e when addressing the servlet so the original session is never found. You might look into passing the session ID to the applet ...

4. [if] session.getAttribute !=null

6. session's getAttribute method help.

7. help needed with session.getAttribute?

This may sound obvious, but is your action class called? I had a similar error where what I set in the session was not being read. Then I realized I was directly accessing the jsp page, skipping my servlet where the session attribute was set. Are you clearing out any variables in the session between your action servlet and the jsp? ...

9. Error with session.getAttribute()