Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to check the list is empty or not using jstl  RSS feed

 
Vijay Kumar
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • 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
 
Balasubramani Dharmalingam
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this,
 
Vijay Kumar
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • 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....
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a common problem so a new JSP FAQ entry has been established for it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!