Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Bean Disscussion

Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic