You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Daniel <da...@top-it.com.br> on 2004/03/16 20:29:33 UTC

logic:equal

Why it doesn't work, but if I change the value of bean:define value attribute for value="1", it's work????? I need compare dinamic values.


   <bean:define id="string" value="<%=1%>" />
   <logic:equal name="string" value="1">
    The string contained the word Struts
   </logic:equal> 


cheers
Danie S.

RE: logic:equal

Posted by Robert Taylor <rt...@mulework.com>.
Daniel, it would be easier to use JSTL for this:

<c:if test="${myValue == 1}">
The string contained the word Struts.
</c:if>

JSTL can compare values coming from any scope; application, session, pagecontext, request, or request parameters.


Currently, the <bean:define .../> value attribute doesn not accept runtime values.
You can verify this by looking at the struts-bean.tld


Another alternative would be to use the Struts-EL tag libraries.

robert

> -----Original Message-----
> From: Daniel [mailto:daniel@top-it.com.br]
> Sent: Tuesday, March 16, 2004 2:30 PM
> To: Struts Users Mailing List
> Subject: logic:equal
> 
> 
> Why it doesn't work, but if I change the value of bean:define value attribute for value="1", it's work????? I need 
> compare dinamic values.
> 
> 
>    <bean:define id="string" value="<%=1%>" />
>    <logic:equal name="string" value="1">
>     The string contained the word Struts
>    </logic:equal> 
> 
> 
> cheers
> Danie S.

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