How to retrieve a session Bean in the Context in a class with the Context reference

A

asd

Hello this is my problem
in my servlet I set a new session attribute
request.getSession().setAttribute("AAA", new Aaa() );

now I've a Xxx class that has access to the Application Context. In my
Xxx class so I've a
private ServletContext context;

My Xxx class takes in input a String. this string is the sessionId.

Now my question is: with a sessionId string and the attribute name
("AAA") can i retrieve in my Xxx class the bean stored by the
request.getSession().setAttribute(..) in the appContext??

thanks a lot
martina
 
W

www.pulpjava.com

If you're asking if you can get access to data stored in another users
session, the answer is no.

The Session is mapped to a single user, and a single user only.

The ServletContext is global, and can be accessed by any user accessing
your web appliation.

Cheers!

-Cameron McKenzie www.pulpjava.com

Free SCJA Certification Questions: www.scja.com
Free J2EE and WebSphere Tutorials: www.mcnz.com
Free Mock WebSphere Certification Exams: www.examscam.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top