Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

c:forEach, c:out are being ignored event though jar are present

 
Vineet Kumar Garg
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've placed following jars in WEB-INF\lib folder.

C:\Users\vgarg\work2\apache-tomcat-7.0.27\webapps\Beer-v1\WEB-INF\lib\jstl.jar
C:\Users\vgarg\work2\apache-tomcat-7.0.27\webapps\Beer-v1\WEB-INF\lib\standard.jar

in servlet I'm setting as below


in Jsp I've below code and I've verified using EL that values are reaching JSP.


Output being received:


After trying different things I reached the conclusion that c:forEach and and c:out tags are simply not working and the text is being displayed just once.

Any suggestions what's going wrong please?
 
Vineet Kumar Garg
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(May be I should have posted the question an hour back itself as I found the solution after 5 minutes of posting it. :))

I found the problem. I didn't include the taglib in the JSP.



It solved the problem and everything is running good now.
Thanks
-Vineet
 
tsaowe cao
Greenhorn
Posts: 5
IntelliJ IDE jQuery Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Vineet Kumar Garg

have you ever put this line under <html> ?
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>



when put this line in your jsp,you jsp file should like



<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<head>
<title>tsaowe</title>
</head>
<body>


when i put this, i got your expected result

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64982
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tsaowe cao wrote:hi Vineet Kumar Garg have you ever put this line under <html> ?

Where the directive goes in relation to HTML markup is irrelevant. It's usually placed at the top of the file.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic