tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Bayern <bay...@essentially.net>
Subject Re: Dynamic HTML Parameters
Date Fri, 31 Jan 2003 13:19:11 GMT
On Thu, 30 Jan 2003, Chris Yocum wrote:

> Hi all,
>      I have searched the mail archive and I have not found an answer to my 
> questions.  My question is:  I have a <c:forEach> loop that dynamically 
> generates HTML parameters.  Once the user clicks on the submit button,  I 
> programmatically know how many there are since I save the number in a 
> variable.  However, I have no way of combining that number with the param 
> object.  For example, I cannot do <c:out value="${param.thing_}${count}" /> 
> or <c:out value="${param.thing_${count}}" />.
>      I will mock up some code if there is confusion about my question.  
> Thanks for all the help!

You'll want to build up the string first and then use it as a dynamic
property of 'param':

 <c:set var="x" value="thing_${count}" />
 <c:out value="${param[x]}" />

-- 
Shawn Bayern
"JSTL in Action"   http://www.manning.com/bayern


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message