• 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 wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

confusion in running an simple jstl application

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear dudes,
I'm trying to run a simple jsp page which uses jstl tags.

My container and configuration details:
Container: Tomcat 5.5
Downloaded JSTL version: JSTL 1.1 ( from jakarta - apache)

I copied jstl.jar and standard.jar to my webapplications lib folder.

I also copied tld files ( from the tld folder) to my applications WEB-INF
folder and configured the tld files in my web.xml.

In my application through my html page i am getting a name and i'm storing it in a list along with other objects in a servlet and setting this as an attribute to my request object so that my jsp page accesses it.

In my jsp page , i'm using core jstl tag to iterate over this collection and print each element.

My html page is:


could anyone fix this issue and whether jstl1.1 binaries are suited for Tomcat5.5 version.

Regards.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Move the two jar files (jstl.jar and standard.jar) to
webapps/{your-app}/WEB-INF/lib.

Get rid of the tld files that you added.
They exist inside the jars and will be found there.
 
Sheriff
Posts: 67754
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
And remove the tld declaration that you added to the web.xml.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just move standard.jar and jstl.jar in WEB-INF/lib and you don't have to mention any tld for that. There is an error in your jsp code . Instead of writing <c: forEach> you should write <c:forEach> there should be no gap between : and forEach. Another problem is that you have placed a b after</body> ...........once you correct this your code will run fine and give you the output
the name you pass as parameter
sai
narayanan
amma.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<c: forEach var="name" items="${nameList}"><tr><td>${name} </td></tr>
</c:forEach>

Please check this tag you need to use <c:forEach> but check what you have

you have <c: forEach var="name" items="${nameList}"> and see the space. that is the issue.
reply
    Bookmark Topic Watch Topic
  • New Topic