This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes Comparing values in struts using  logic:equal.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Comparing values in struts using  logic:equal.." Watch "Comparing values in struts using  logic:equal.." New topic
Author

Comparing values in struts using logic:equal..

Sam Drake
Ranch Hand

Joined: Jun 05, 2003
Posts: 33
Hi,
I would like to know whether its possible to compare 2 variables in struts.
I have 2 variables say strName1, strName2 in the page context.
How can i compare them in struts to be of the same value using logic:equal
<logic:equal name="strName1" value="???" >
....
....
</logic:equal>
Any idea...
Please help.
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4477
    
    6

The API documentation states that value is a constant value. It can, however, be a runtime expression so you can compare it would be to do something like so:
<logic:equal name='var1' value='<%= pageContext.getAttribute("var2") %>' >


Junilu - [How to Ask Questions] [How to Answer Questions]
 
GeeCON Prague 2014
 
subject: Comparing values in struts using logic:equal..