• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jstl forEach : Error

 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i'm trying to use jstl in my application. i've taken an example from the head first series book for forEach tag.

JSP code :



Servlet code :



when i run the application i get the following error :



do i have to specify somehting in web.xml for <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> ???

following is my web.xml file

 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you included the JSTL library?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64617
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the JSP FAQ which covers this in detail.
 
Matias Gel
Greenhorn
Posts: 3
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ye...problem solved... i had installed jstl.jar in jboss/lib but dint restart server..so..
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jigar, don't feel bad. You should know that all of us have done something like this (ie - forgot to restart the server after changing a web app)at one time or another :-)
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No actually there are two lib directories in Jboss

1)D:\jboss-4.0.5.GA\server\default\lib

2)D:\jboss-4.0.5.GA\lib

so i was confused where to put jstl.jar

first i copied jstl.jar in 1)D:\jboss-4.0.5.GA\server\default\lib and restarted the server.. but still it was giving the error.

than at second location 2)D:\jboss-4.0.5.GA\lib

than i dint restart server. it was still giving same error.. but than after 10 mins i restarted server. and it was working fine...

and right now there is no jstl.jar in none of the following location

1)D:\jboss-4.0.5.GA\server\default\lib

2)D:\jboss-4.0.5.GA\lib

but still my application is working fine...

is there any logic behind it ???
 
Sahid Khan
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and right now there is no jstl.jar in none of the following location

1)D:\jboss-4.0.5.GA\server\default\lib

2)D:\jboss-4.0.5.GA\lib


Is that packaged in your application war file? in WEB-INF/lib?
 
Jigar Naik
Ranch Hand
Posts: 762
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes.. i did...
 
Sahid Khan
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes.. i did...


And that is why it works. Basically at runtime web server tries to find the library in following order: web server main library (jboss_home/lib), web server particular mode library (jboss_home/mode/lib), then in your application war file (WEB-INF/lib). In fact you should put all java archive files in WEB-INF/lib directory on which your application depends upon.

HTH.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic