• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

struts and jstl html:option

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • 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
  • 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...
 
If you like strawberry rhubarb pie, try blueberry rhubarb (bluebarb) pie. And try this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!