Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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...
 
Sunglasses. AKA Coolness prosthetic. This tiny ad doesn't need shades:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic