JSTL variable values ββare not displayed in EL. For example, this code:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="s" uri="http://www.springframework.org/tags" %> <html> <body> <c:forEach var="i" begin="1" end="5" > <c:out value="${i}" /> </c:forEach> </body> </html>
the browser displays: ${i} ${i} ${i} ${i} ${i}
Or this one:
<c:set var="someVar" value="Hello"/> <c:out value="${someVar}"/>
browser displays: ${someVar}
I use Spring-MVC 3 and Maven to create a sample project, deploying it to Tomcat 7. In the context of Spring, I have a permissions configurator configured as follows:
<bean class= "org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass" value=" org.springframework.web.servlet.view.JstlView"></property> <property name="prefix" value="/WEB-INF/"></property> <property name="suffix" value=".jsp" /> </bean>
The presented model variables processed by the Spring form are also not shown.
Mavens pom.xml has the following jstl dependencies:
<dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> <scope>runtime</scope> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.1</version> <scope>provided</scope> </dependency>
So, any suggestions to fix this?
source share