You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "White, Joshua A (HTSC, CASD)" <Jo...@thehartford.com> on 2003/07/28 12:51:59 UTC

How to use JSTL taglib with struts html taglib

I would like to use the struts html taglig to generate a bunch of
checkboxes.  While the following is not correct, it encapsulates what I
would like to do:

<c:forEach items="${myForm.myInformationView}" var="basicView">
    <html:checkbox property="myItems" value="<c:out
value='${basicView.itemId}'/>"/><br>
</c:forEach>

I am looping throught the collection using the jstl forEach tag.  The
problem is that c:out is not evaluated as a runtime expression (actually, it
is not evaluated at all).  Using c:set to set a page level variable that you
could use in a runtime expression does not work either.

Is there a way to use both jstl and the struts html taglib here?  How can it
be done?

Regards, 

Joshua



This communication, including attachments, is for the exclusive use of 
addressee and may contain proprietary, confidential or privileged 
information. If you are not the intended recipient, any use, copying, 
disclosure, dissemination or distribution is strictly prohibited. If 
you are not the intended recipient, please notify the sender 
immediately by return email and delete this communication and destroy all copies.


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


Re: How to use JSTL taglib with struts html taglib

Posted by R Balaji <ba...@india.adventnet.com>.
Dear Joshua,

The html tags does not understand that expressions were passed and  
needs to be evaluated. The html-el tags will evaluate the run time 
expressions , where you do not even need JSTL .

please do this, i believe this will work,

* <html-el:checkbox property="myItems" value="${basicView.itemId}"/>
*
with regards,

Balaji*
*



White, Joshua A (HTSC, CASD) wrote:

>I would like to use the struts html taglig to generate a bunch of
>checkboxes.  While the following is not correct, it encapsulates what I
>would like to do:
>
><c:forEach items="${myForm.myInformationView}" var="basicView">
>    <html:checkbox property="myItems" value="<c:out
>value='${basicView.itemId}'/>"/><br>
>
*
*

*
*


></c:forEach>
>
>I am looping throught the collection using the jstl forEach tag.  The
>problem is that c:out is not evaluated as a runtime expression (actually, it
>is not evaluated at all).  Using c:set to set a page level variable that you
>could use in a runtime expression does not work either.
>
>Is there a way to use both jstl and the struts html taglib here?  How can it
>be done?
>
>Regards, 
>
>Joshua
>
>
>
>This communication, including attachments, is for the exclusive use of 
>addressee and may contain proprietary, confidential or privileged 
>information. If you are not the intended recipient, any use, copying, 
>disclosure, dissemination or distribution is strictly prohibited. If 
>you are not the intended recipient, please notify the sender 
>immediately by return email and delete this communication and destroy all copies.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>  
>