struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Günther Wieser <gwie...@creative-it.com>
Subject AW: JSTL c:if question
Date Mon, 28 Feb 2005 23:30:44 GMT
 
i think your test won't work as strings get compared using the equal method
and not "==" (but i have no idea what the "test" attribute does in the tag
class....).

if you use
<logic:equals name="mode" value="a">whatever needs to be done</logic:equals>
it should work (at least it works for me ;-) )

kr,
guenther

-----Ursprüngliche Nachricht-----
Von: David Johnson [mailto:chachany@gmail.com] 
Gesendet: Dienstag, 01. März 2005 00:24
An: Struts Users Mailing List
Betreff: JSTL c:if question

a little off topic but..

I have a variable (a string named "mode") in request scope and I want to
display something conditionally in the JSP. Right now, I have the following,
which doesnt work. The error is

2: Illegal scope attribute without var in "c:if" tag.

What am I doing wrong?

<c:if test="${mode}=='a'" scope="request">
   first thing
</c:if>
<c:if test="${mode}=='b'" scope="request">
   second thing
</c:if>
--
-Dave
ChaChaNY@Gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message