You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bill Taylor <bi...@gmail.com> on 2004/08/26 23:30:03 UTC

JSTL and Struts Tags

I haven't been successful with using the <c:set> tag and using this
output value within a Stuts tag.

The variable "engineTest" (below) does not seem to output correctly as
a boolean value to the <html:multibox> tag. However, as a test, I can
succesfully use the scriptlet variable "val" which invokes the disable
attribute correctly.

I have also tried: ${Boolean.TRUE.booleanValue} with no luck.

Should I be able to do this or should use the tried and true scriptlets?

Example:

<% boolean val = false%>

<c:forEach begin="0" end="3"
items='${saveUserPreferences.map.searchEngines}' var='engine'>
	<c:if test="${engine.active == 0}">
			<c:set  var="engineTest" value="${true}"/>
			<% val = true;%>					
	</c:if>

<%--disable attribute not invoked--%>
<html:multibox disabled="${engineTest}" property="userSearchEngines">
     <c:out value='${engine.id}' />
</html:multibox>
&nbsp;<c:out value='${engine.name}' />&nbsp;<c:out
value='${engine.description}' />

<%--works correctly--%>
<html:multibox disabled="<%=val%>" property="userSearchEngines">
     <c:out value='${engine.id}' />
</html:multibox>
&nbsp;<c:out value='${engine.name}' />&nbsp;<c:out
value='${engine.description}' />
<br/>

</c:forEach>

-- 
Bill Taylor

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


Re: JSTL and Struts Tags

Posted by Can Zheng <ca...@gmail.com>.
Hi Bill,

Make sure you have activated El evaluation. My suggestion: add "<%@
page isELIgnored="false"%>" on top of your JSP file. This precedes any
settings in the web.xml file

BTW, this <c:set.../> script is OK, at least it works on my machine.

On Thu, 26 Aug 2004 17:30:03 -0400, Bill Taylor
<bi...@gmail.com> wrote:
> I haven't been successful with using the <c:set> tag and using this
> output value within a Stuts tag.
> 
> The variable "engineTest" (below) does not seem to output correctly as
> a boolean value to the <html:multibox> tag. However, as a test, I can
> succesfully use the scriptlet variable "val" which invokes the disable
> attribute correctly.
> 
> I have also tried: ${Boolean.TRUE.booleanValue} with no luck.
> 
> Should I be able to do this or should use the tried and true scriptlets?
> 
> Example:
> 
> <% boolean val = false%>
> 
> <c:forEach begin="0" end="3"
> items='${saveUserPreferences.map.searchEngines}' var='engine'>
>        <c:if test="${engine.active == 0}">
>                        <c:set  var="engineTest" value="${true}"/>
>                        <% val = true;%>
>        </c:if>
> 
> <%--disable attribute not invoked--%>
> <html:multibox disabled="${engineTest}" property="userSearchEngines">
>     <c:out value='${engine.id}' />
> </html:multibox>
> &nbsp;<c:out value='${engine.name}' />&nbsp;<c:out
> value='${engine.description}' />
> 
> <%--works correctly--%>
> <html:multibox disabled="<%=val%>" property="userSearchEngines">
>     <c:out value='${engine.id}' />
> </html:multibox>
> &nbsp;<c:out value='${engine.name}' />&nbsp;<c:out
> value='${engine.description}' />
> <br/>
> 
> </c:forEach>
> 
> --
> Bill Taylor
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


-- 
Best regards,

Can Zheng

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