• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts and jstl html:option

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Here is the issue:

I am using JSTL tag to populate the html:select

<html ption value="">Select partner</html ption>
<c:forEach items="${abc}" var="p">

<html ption value="${p.id}" >${p.name}</html ption>
</c:forEach>
</html:select>

where is abc is a list.

this is working fine.

now the issue is in another Edit page I am using the same above code and I need to pre select the option which user has selected in Add page.

The id above is stored in another bean which is accessible in the same jsp....but some how i am not getting the idea to combine the value from bean and jstl tag to pre select the option.

Please help if some body know the solution or have any idea....

Thanks,

Ankur
 
Ankur Sharma
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
may be i should have read the struts documentation for html tag before posting this query.

i found the solution right after posting this question.....

just gave the name of the bean in html:select and it did the magic :-)

thanks guys....hope this will help someone...probably that will make this posting worth :-)

Merry Christmas and Happy Holidays...
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic