jlars62
jlars62

Reputation: 7383

Tomcat is not processing jstl ${}

I am running tomcat7 on an Amazon EC2 Linux instance. For some reason that I cannot figure out, the jstl ${} syntax is not getting processed. What is weird, at least in my mind, is that the <c:forEach /> tags are getting processed correctly.

So for example, I have this in my jsp

<c:forEach items="${flavors}" var = "f">
    ${f.value}
</c:forEach>

And this is what is getting printed on my page : ${f.value}.

So, the <c:forEach /> tag does not get printed out but the ${} synatax does.

I have verifed that there are 4 elements in the flavors list by viewing them with <%= request.getAttribute("flavors")%>.

Any idea what is going on and how to fix this?

Thanks!

EDIT: Added relevant portion of my pom.xml

<dependency>
  <groupId>jstl</groupId>
  <artifactId>jstl</artifactId>
  <version>${jstl.version}</version>
</dependency>


<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>javax.servlet-api</artifactId>
  <version>3.0.1</version>
  <scope>provided</scope>
</dependency>

<dependency>
  <groupId>org.glassfish.web</groupId>
  <artifactId>jstl-impl</artifactId>
  <version>1.2</version>
  <exclusions>
    <exclusion>
      <artifactId>servlet-api</artifactId>
      <groupId>javax.servlet</groupId>
    </exclusion>
    <exclusion>
      <artifactId>jsp-api</artifactId>
      <groupId>javax.servlet.jsp</groupId>
    </exclusion>
  </exclusions>
</dependency>

Upvotes: 2

Views: 648

Answers (2)

Sanjay
Sanjay

Reputation: 2503

pl add following attribute to top of jsp. <%@ page isELIgnored="false" %>

Upvotes: 2

zulqarnain
zulqarnain

Reputation: 1735

You need the JSTL libraries on your tomcat lib. Refer to the links below: Running JSTL on Tomcat 7 and download from: Tomcat JSTL libraries dowload Also here: Tomcat 7 and JSTL

Upvotes: 0

Related Questions