How do I access a JavaBean that already has been instanciated (with scope session) in an JSP page? I know how to do this from a JSP but how do I do this from another Class or Bean within the web application?
Thanks in advance for any suggestions,
El
Discussions
Web tier: servlets, JSP, Web frameworks: How do I access JavaBean instanciated in JSP from another Class
-
How do I access JavaBean instanciated in JSP from another Class (1 messages)
- Posted by: Elmar Schmidt
- Posted on: July 27 2004 03:25 EDT
Threaded Messages (1)
- How do I access JavaBean instanciated in JSP from another Class by Rene Zanner on July 28 2004 06:27 EDT
-
How do I access JavaBean instanciated in JSP from another Class[ Go to top ]
- Posted by: Rene Zanner
- Posted on: July 28 2004 06:27 EDT
- in response to Elmar Schmidt
If you have a reference to the HttpSession called "session" in your class, you can simply call
[Bean-Type] bean = ([Bean-Type]) session.getAttribute("[Bean-ID]");
Cheers,
René