Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

very un-natural problem with login:equal tag

 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"}'>
</c:if>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic