Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reload collections that initialized on startup?

 
Dave Bosky
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic