This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Struts and the fly likes very un-natural problem with login:equal tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "very un-natural problem with login:equal tag" Watch "very un-natural problem with login:equal tag" New topic

very un-natural problem with login:equal tag

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
I have a un-natural problem here

Im trying to use :

it never enter the above block.
even i tried and showed sysvar by using the following code line in the browser

I can see that its value
is loop bu there is no luck to enter the above block.
No my question is :
while the value that is inside sysvar is equal to what Im checking with Struts logic tag , why it never enter the block ?
is it an encoding problem ?

can some one please tell me how to write that conditional block in JSTL ?
maybe JSTL Do it correctly.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
In order for a variable to be recognized by either a struts logic:xxx tag or a JSTL tag, it must be in one of the scopes.(page, request, session or application).

Try putting the following code somewhere before your logic:equal tag.

<% pageContext.setAttribute("sysvar", sysvar); %>

To answer your second question: The equivalent JSTL tag is:

<c:if test='${sysvar == "loop"}'>

Consultant, Sima Solutions
I agree. Here's the link:
subject: very un-natural problem with login:equal tag
jQuery in Action, 3rd edition