struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Günther Wieser <>
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

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 ;-) )


-----Ursprüngliche Nachricht-----
Von: David Johnson [] 
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 test="${mode}=='b'" scope="request">
   second thing

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message