Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL if statement does not work

 
Urs Wagner
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to use <c:if> to include an additonal page.

For testing I use both statements.

<c:if test="${Partner.loggedIn=='false'}" >
<%@include file="login2.jsp" %>
</c:if>

<c:if test="${Partner.loggedIn=='true'}" >
<%@include file="login2.jsp" %>
</c:if>

It does not work. There is no html code from login2.jsp.
Does have anyone an advice? For example how I can debug it.

Thanks

Urs
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you doing this in a JSF page?
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See what <cut value="${Partner.loggedIn}"/> prints out.
Also, if loggedIn is a boolean, you probably do not want quotes around false or true.
[ October 13, 2005: Message edited by: Marc Peabody ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If loggedIn is a boolean, I'd code it just as Marc showed it without any comparison at all.

Not really a JSF question, is it?
 
Urs Wagner
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<c ut value="${Partner.loggedIn}"/> prints out ${Partner.loggedIn}.

I am bit confused. Partner is bean and loggedIn is a boolean property. Writing without qqote does also not help.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the JSP forum...
 
Eddy Lee Sin Ti
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which version of JSTL you are using? and do you turn the EL expression off?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also need to know what JSP container and version you are using.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic