Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

confusion in running an simple jstl application  RSS feed

 
scart scott
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • 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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And remove the tld declaration that you added to the web.xml.
 
Shashi Ranjan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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.
 
pravin kantipudi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!