File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes jstl forEach : Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "jstl forEach : Error" Watch "jstl forEach : Error" New topic
Author

jstl forEach : Error

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 756
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



Jigar Naik


Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

Have you included the JSTL library?


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61187
    
  66

See the JSP FAQ which covers this in detail.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Matias Gel
Greenhorn

Joined: Nov 28, 2005
Posts: 3
http://faq.javaranch.com/view?SetupJstlForJsp2
Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 756
ye...problem solved... i had installed jstl.jar in jboss/lib but dint restart server..so..
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
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

Joined: Dec 12, 2006
Posts: 756
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

Joined: Jun 27, 2007
Posts: 41
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

Joined: Dec 12, 2006
Posts: 756
yes.. i did...
Sahid Khan
Ranch Hand

Joined: Jun 27, 2007
Posts: 41
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jstl forEach : Error