• 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Problem with JSTL  RSS feed

 
Sheriff
Posts: 9613
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well after using scriptlets for a long time, I was using JSTL yesterday but I couldn't make it work. I was doing this



There was an object myComp in the request scope. Still the code in the if didn't got executed. Using EL worked fine



I used <c:choose> <c:when> and it worked in case of a session scoped attribute. Did I do something wrong with the <c:if>??
 
Ranch Hand
Posts: 437
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Ankit use >
 
Ankit Garg
Sheriff
Posts: 9613
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to use EL but it said that you can't use EL according to the TLD file. I'm using this tag library

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>

I tried using ne instead of != but it didn't work without the EL...
 
Chinmaya Chowdary
Ranch Hand
Posts: 437
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Ankit I think you are using JSTL1.0, try using JSTL1.1, JSP2.0. And change the taglib directive to
 
Author and ninkuma
Marshal
Posts: 66787
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What led you to believe that null was valid in the EL? Check out the empty operator.
 
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Null is legal, as are comparisons to it. Empty might be better, unless you need to specifically check for an empty container vs. a null object.
 
Ankit Garg
Sheriff
Posts: 9613
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that was it. I was using the wrong version of JSTL . I was suspicious that's why I posted the taglib directive here .

Thanks Chinmaya, Bear and David ...
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66787
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

David Newton wrote:Null is legal, as are comparisons to it.


Oops. Brain fart.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!