Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Other Application Frameworks and the fly likes Spring with JSTL the expresion c:out value= Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Spring with JSTL the expresion c:out value="${result}" not working" Watch "Spring with JSTL the expresion c:out value="${result}" not working" New topic
Author

Spring with JSTL the expresion c:out value="${result}" not working

Paco Martin Duque
Greenhorn

Joined: Oct 01, 2008
Posts: 9
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 ]
Paco Martin Duque
Greenhorn

Joined: Oct 01, 2008
Posts: 9
Hi everyone...

Surfing I get the following post in other forum where the solution is:

http://www.velocityreviews.com/forums/t133907-jstl-and-cout-value-not-being-evaluated.html

The solution is:
<%@ page isELIgnored="false"%>

See you soon!
 
 
subject: Spring with JSTL the expresion c:out value="${result}" not working
 
Similar Threads
c:out JSTL tag of the core libaray of general purpose
How to enable EL in a jsp page?
JSTL 1.1 and Tomcat 5 basic problem
jstl error
simple JSTL problem