This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Servlets and the fly likes reload collections that initialized on startup? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "reload collections that initialized on startup?" Watch "reload collections that initialized on startup?" New topic
Author

reload collections that initialized on startup?

Dave Bosky
Ranch Hand

Joined: Dec 16, 2003
Posts: 72
I have a servlet that loads several collections that are using to populate dropdown listbox. Snippet below.


This servlet is configured to load on startup in my web.xml file.
How can I reload this list after I add new values to the list?

Is there a better way to accomplish caching of collections used to populate common listboxes?

Thanks....
Dave
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Is there a better way to accomplish caching of collections used to populate common listboxes?


Yes.
Use a context listener to load the values into either a singlton object or a context scoped bean. Then, have your servlet read from that object at run time.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: reload collections that initialized on startup?
 
Similar Threads
deploying java web application having huge class files
Reloading XML files
Session / Message Driven Beans load sequence
tomcat 5 auto reload : Missing web.xml
selectManyListbox not setting value