Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Ram Gokul
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • 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 ..
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • 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 <cut> tag:

<html:link page="/ViewRatecodes.do?ratecode='${rateDetails.ratecode}">
[ November 02, 2006: Message edited by: Merrill Higginson ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic