This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi Ranchers, Iam using logic iterate tag,using iteration i have to display some items in the select box, how to display the last item as default value? (Please let me know whether I have given enough details...) Thank you in advance, ramna
If you use Struts tags to display the select box (<html:select> and <htmlptions> or <htmlptionsCollection>) The value that will show as selected is tied to the property of the ActionForm bean specified in the tag. For example, if you specify <html:select property="foo" > and in your Action form, calling getFoo() returns "xyz". The option that will show as selected is the one with value="xyz".
I got blind or what. Is it really something related to Struts? Sorry, I am asking because I am not seeing anything like that in the original post.
[Edited] Got it. No worries. [ February 13, 2007: Message edited by: Adeel Ansari ]
Joined: Aug 15, 2004
Originally posted by Merrill Higginson: I'd suggest you change your JSP so that it does use <html:select>. While there are ways to do it otherwise, it's much easier with the Struts tags.
Thats not true. Why one would start using struts just for this thing?
You can use,
Joined: Feb 15, 2005
Just a little history:
This was originally posted in the Struts forum. Generally it can be assumed that if someone posts in the Struts forum, their application already has been built around Struts. If one already has a Struts application, it is in fact true that it's easier to use the Struts tags.
As it became clear that Ramna may not be looking for a Struts solution, but simply posted to the wrong forum, I then moved the thread to the JSP forum hoping that one of you friendly and helpful developers who frequent the JSP forum could help Ramna out.