• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

jstl forEach : Error

 
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you included the JSTL library?
 
Sheriff
Posts: 67557
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
See the JSP FAQ which covers this in detail.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://faq.javaranch.com/view?SetupJstlForJsp2
 
Jigar Naik
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ye...problem solved... i had installed jstl.jar in jboss/lib but dint restart server..so..
 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ???
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes.. i did...
 
Sahid Khan
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic