Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

logic equal tag and permanent value

Status
Not open for further replies.

areznik

Programmer
Aug 7, 2002
25
0
0
US
I ve run into this many times when i have to compare something with something else in a logic:equal or notEqual tags and that something else is not always a permanent value like "true" or "1". for example, i would want to compare against a bean property and based on that, show one style or another. I know how to do this, my question is why i can't do it like this:
<logic:equal name="bla" value="<bean:write name="foo" property="bar" />">

</logic:equal>

single quotes dont work either, since the tag thinks that anything inside the value attribute's quotes is a literal value and is interpreted as a string...very frustrating...
so, i do something like value="<%=request.getParameter("foobar")%>" and it sux because thats not what i want to do
 
One way I can think of is:

Code:
<bean:define id= "cValue" name= "foo" value= "bar"/ > 
<logic:equal name="bla" value="<%= cValue % >">
...
</logic:equal>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top