But I need to make several Locales available for this list. How would I also do that with this Country List?
_____ Thank You Mick Knutson Sr. Designer - Project Trust aUBS AG, Financial - Zürich Office: +41 (0)1/234.42.75 Internal: 48194 Mobile: 079.726.14.26 _____ -----Original Message----- From: Dan Allen [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2003 3:09 PM To: Struts Users Mailing List Subject: Re: Country select pull down. I find that the best way to create a (somewhat static) select list of options on an html page (such as a list of countries, states, industries, services, etc..) is to make a Bean for the collection. Then, in the jsp page, you simply do the following: <jsp:useBean id="industryOptionBean" scope="session" class="net.creativerge.struts.bean.IndustryOptionBean"/> <html:select property="industry"> <html:option value="">by Industry</html:option> <html:optionsCollection name="industryOptionBean" property="industrySearchOptions"/> </html:select> You can choose any scope you want, but in some cases, if the data that the Bean retrieves is constantly changing, you might want to go with the page scope so you are sure it is the freshest information. Since new states and/or countries are not added that often, you might best go with application scope. The way that the jsp:useBean tag works is that it creates the bean if it does not exist in the scope provided, otherwise it just ignores the call. I see so many people struggle with having the create select boxes and I really think this is the best way to go. The problem with putting a bean into the scope using an action is that unless you put it in a base action, you have to really think to make sure the user can't get to the page without having the bean initialized. This especially becomes a problem when you are including the select box on all pages (then each pages action has to remember to check for this population). To me it seems best to ask the jsp page to make you a bean before you use the collection, or if you are using tiles, have the tile controller prepare the bean. Dan -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Daniel Allen, <[EMAIL PROTECTED]> http://www.mojavelinux.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "I'm old enough to know better, but still too young to care." - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Visit our website at http://www.ubswarburg.com This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any securities or related financial instruments. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]