• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

how to check the list is empty or not using jstl

 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi..
I am using jstl
I have a array list "jFaultsList" which contains falts nos.
during the execution time I just wanto chcek is there any element in this list or not.
if there is any element it should diaply in select box otherwise it should diasplay "No-fault"
I am checking that falut list using this line


but it does not display any element even list is full with the fault codes

please suggest me that how can I check that list is empty or not....



I am using tomcat 5 & win-xp

thanks
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try this,
 
Vijay Kumar
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi......
Balasubramani

is not working
if simply print the list using this code its display all the list element

but using if condition its not working....
 
Sheriff
Posts: 67597
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The syntax that Balasubramani gave you is correct. If it is not working it is likely a setup error that prevents the EL from being correctly evaluated.

You said you are using Toncat 5. What version of the JSTL are you using? What URI are you using to load the JSTL Core library on the page? And how have you declared your web application in web.xml? Using the 2.3 DOCTYPE or the 2.4 XML Schema?

For all this to work with Tomcat 5, you should be:

1) Using JSTL 1.1
2) Load the Core library via URI http://java.sun.com/jsp/jstl/core
3) Declare your web app using the 2.4 XML Schema
 
Bear Bibeault
Sheriff
Posts: 67597
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a common problem so a new JSP FAQ entry has been established for it.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic