I'm making a guess, since I'm too lazy to check the actual jsp source
code, but i would assume, that bean:define defines the variable to the
scope page and ties it to  the page for scripting.
When you perform your: 
isEmpty = false; you change the value of the scripting variable, but
not the one from the pageContext / scope.
So de-facto you have two variables with different meaning, one isEmpty
in the scope and one in the page.
Logic:equals looks up in the page scope, but your scriptlet looks in
the page itself. That's why the values are different.

Why don't you define the variable with the proper value in the iteration?
In this case you would have no scripting variable, but logic:equal will work.

regards
Leon

On 9/15/05, Filipe Pomar <[EMAIL PROTECTED]> wrote:
> Guys, I have the following pseudo-code:
> 
> <bean:define id="isEmpty" value="true" type="java.lang.String"/>
> 
> // begin: some iteration
>         <%isEmpty="false";%>
> // end: some iteration
> 
> 
> ... then I want to test if isEmpty is true. The body of following code
> always get executed:
> <logic:equal name="isEmpty" value="true">
>         // some code that always run
> </logic:equal>
> 
> 
> ... though, the behavior I expected to get is seen only when using
> scriptlets, as follow:
> <% if ("true".equals(isEmpty)) { %>
>         // works fine
> <% } %>
> 
> 
> Any ideas on why this happens are much appreciated.
> 
> Regards,
> Filipe
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to