On Apr 8, 2005 1:12 PM, Anil <[EMAIL PROTECTED]> wrote: > Matt Raible <lists <at> raibledesigns.com> writes: > > > > > As far as drop-downs, I typically populate all (or most) of mine from a > > database at application startup using a ServletListener. I stuff these > > into the application scope as Lists of LabelValue beans. Then I code > > up a ReloadAction that can call my Listener to reload them all. I've > > found this useful so I don't have to restart the app if data changes. > > > > Matt > > > > If I have edit screens for the drop-downs, I'll replace the List in > > application scope after saving. > > If the application scope has been used to store the drop-down values, how will > you handle the updates on data in application scope in clustered environment? > Is there any way to get rid of the problem? >
One option would be to add an administrative action in your URL that calls the code to reinitialze the application scoped lists (i.e. the same code called by your context listener or init method to load them in the first place)? That way, you can set up a button or something that triggers reloading whenever someone knows that it is necessary. An alternative strategy I've used in the past is to have a single application scope bean that exposes each of the lists as a read-only property. The getter for that list, then, could do something (such as a cheap database read to get a last modified timestamp or something) to see if it needs to refresh the list before returning it. That way, the user of the list never has to worry about reloading. > Anil. Craig --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]