Hi everyone,
I have just finished a little
test about SPRING with JSTL.
I got a suprise when the expresion :
<c
ut value="${result}"/>
returns
${result}
but it's worse because the following expresion:
<c
ut value="1+2+3"/>
<br>
<c
ut value="${1+2+3}"/>
return
1+2+3
${1+2+3}
I show you what I have:
1)
JSP include:
<%@ page session="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
(*) the tags lib
2) JSP
<%@ include file="/WEB-INF/jsp/include.jsp" %>
<html>
<head>
<title>Test</title>
</head>
<body>
<h2>Test #1!</h2>
<p>
<c
ut value="${result}"/>
<br>
<c
ut value="1+2+3"/>
<br>
<c
ut value="${1+2+3}"/>
</p>
</body>
</html>
3) The spring controller:
public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
...
return new ModelAndView("TransactionTest.jsp", "result" , "Hello");
}
4) My web.xml
...
<taglib>
<taglib-uri>
http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
</taglib>
</web-app>
6) Configuration:
- spring-framework-2.5.6
-
Jboss 4.2.3
Any idea of what it's happening? Have I forgotten anything?
Thanks in advance.
[ December 05, 2008: Message edited by: Paco Martin Duque ]