• 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

how to get variable of c:forEach in a html:link tag

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have follownig code where i am getting all rate codes in a <c:foreach Loop>
Inside the loop I want to contruct a <html:link tag > with primary key .
what is the best way to do this....

====

<c:forEach var="ratedetails" items="${rateDetailsArray}" >
<html:link page="/ViewRatecodes.do?ratecode='<c ut var='${ratecodes.ratecode}/>' ">
<bean:message key="link.AddressAction"/>
</html:link>
</c:forEach>

===
This is not working ..
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all, you need to make sure you're using the html-el version of the tags. Your taglib definition should be:

<%@taglib uri="http://jakarta.apache.org/struts/tags-html-el" prefix="html" %>

and the struts-el.jar file needs to be in your WEB-INF/lib directory.

Then you can just use the EL expression without an enclosing <c:out> tag:

<html:link page="/ViewRatecodes.do?ratecode='${rateDetails.ratecode}">
[ November 02, 2006: Message edited by: Merrill Higginson ]
 
You are HERE! The other map is obviously wrong. Better confirm with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic