This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Bean instantiation from JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Bean instantiation from JSP" Watch "Bean instantiation from JSP" New topic
Author

Bean instantiation from JSP

Ian Whitelaw
Greenhorn

Joined: Mar 30, 2000
Posts: 13
I have a JSP, shown below, which uses a JavaBean to write to an Access database. My understanding of the jsp:useBean tag is that it is will locate and use a bean if one exists, otherwise it instantiates a new one. Is this right?
If it is, why do I get a new instance of my bean whenever I submit the page, even when I specify the bean's scope as "session"? I don't appear to be getting a new session (Session ID remains the same) but the InstanceID (determined in the bean's constructor) changes every time.
 
Have you checked out Aspose?
 
subject: Bean instantiation from JSP
 
It's not a secret anymore!