On Apr 8, 2005, at 2:12 PM, Anil 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?



I tend to do this mostly for drop-downs that are pretty much static, but might change once a week/month. I'm probably over-engineering in most cases - but once the infrastructure is setup, it's easy to do. In a clustered environment, I'd probably keep the same solution and take the hit on application startup. Otherwise, you could do request-scoped lists when you load your forms - or use something like XmlHttpRequest (the DWR project is nice - http://drw.dev.java.net) to populate drop-downs when your pages loads. Spring MVC is pretty slick in that their form controllers have a "referenceData()" method that's specifically designed to populate drop-downs and such.


Matt


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to