Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
asd - 09 Nov 2006 14:32 GMT
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
www.pulpjava.com - 09 Nov 2006 17:00 GMT
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

> Hello this is my problem
> in my servlet I set a new session attribute
[quoted text clipped - 12 lines]
> thanks a lot
> martina


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.