This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

reload collections that initialized on startup?  RSS feed

 
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
Boost this thread!