| Author |
jstl nested inside bean:write tag ?
|
Ronan Dowd
Ranch Hand
Joined: Jan 21, 2006
Posts: 84
|
|
I want to render an input box "n" times (the value of n will be a request attribute). I tried using JSTL forEach as below: <c:forEach var="count" begin="0" end="${request.numberOfTimes}"> <html:text property='<%= "fieldValue[" + count + "]"%>'/> </c:forEach> This doesnt seem to work. I know that i can get the value of the current count by doing <c ut value="${count}"> but I can't nest this JSTL fragment inside my "<%= .... %>" tags! Essentially i want count to be printed for each iteration of the loop. Can someone provide me with a code sample if poss of how to get around this? is there a way i can - either nest my JSTL inside my "<%= .. %>" - or using some other struts way, render my count value Thanks. Ronan.
|
SCJP 1.4 | OCWCD JEE 5
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
I'd suggest using the EL version of the Struts tags. They allow you to embed EL expressions in your tags. Just make sure that the struts-el-1.3.x.jar is in your WEB-INF/lib directory and reference the URI http://struts.apache.org/tags-html-el in your taglib definition. Once you do this, you can do the following:
|
Merrill
Consultant, Sima Solutions
|
 |
 |
|
|
subject: jstl nested inside bean:write tag ?
|
|
|