0
votes

I have a simple test page with the following statement but it appears that the ${} tags are not being processed by Tomcat and i get no errors in the log.

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>JSTL Test Example</title>
<body>
Setting value using c:out <c:set var="name" scope="request" value="Testing" /><br>
Value is: <b><c:out value="${name}"/></b><br>
</body>
</html>

Browser Output: Setting value using c:out Value is: ${name}

Using the information from https://stackoverflow.com/tags/jstl/info I verified 1) Tomcat lib has jstl.2 jar , there are no duplicate jars - if i remove this jar i get a big exception complaining about missing tag classes. 2) My webapp does not have jstl jar in the classpath. 3) Tomcat web.xml has the correct servlet specification

<web-app 
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"                   
version="2.5">

Any help would be greatly appreciated. Thanks

1
I was missing the servlet 2.5 declaration. It is working now. Sorry for the confusion. The stack overflow info link on jstl confirmed this upon checking again.sriram
Post your comment as answer and mark it with the green check in two days.Luiggi Mendoza

1 Answers

0
votes

their may be conflict of jsp-api jar

remove jstl.version.jar from tomcat lib

and add directly dependency in your project

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
</dependency>

and try !