This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

JSTL if statement does not work  RSS feed

 
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
 
Ranch Hand
Posts: 15304
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?
 
pie sneak
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See what <c:out 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 ]
 
Marshal
Posts: 67239
170
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
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the JSP forum...
 
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
Marshal
Posts: 67239
170
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.
 
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad:
Become a Java guru with IntelliJ IDEA
https://www.jetbrains.com/idea/
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!