wood burning stoves 2.0*
The moose likes Servlets and the fly likes Bean Disscussion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Bean Disscussion" Watch "Bean Disscussion" New topic

Bean Disscussion

Anthony Smith
Ranch Hand

Joined: Sep 10, 2001
Posts: 285
I have this webapp that has several jsps and a few servlets. All of these will need to access varios bean methods. How ever I would like to store an instance of my beans in either the application scope or the session. I want to this the best way possible.
Originally I had a servlet setup in my web.xml to automatically load on startup. This servlet will create an instance of all my beans and load them in the session.
I would then have one jsp that was included with everyother jsp page that set the instances of each servlet to a local variable.
After talks with people around me, they say why not just do the <useBean> tag in each one of the jsps. I say no cause I dont want to type <useBean> for each Bean method for every jsp page that I have... On the other hand, I could use a <useBean> in one jsp file and have that file included in eevry jsp.
I am trying to do this in the most efficient way, because most of my beans call a db, and I wat to minimize calls and things like that.
What should I do? What do most peopel do?
I agree. Here's the link: http://aspose.com/file-tools
subject: Bean Disscussion
Similar Threads
few doubts in MVC design pattern and EJB Concepts
JSP:Include question
can't access servlet
Help with MVC implementation
Servlets JSP and Design FAQS