JSP: EL expression is not evaluated

James picture James · Apr 27, 2009 · Viewed 32.1k times · Source

I have a JSP page running on Tomcat 5.5. I have the following code:

 <c:forEach var="i" begin="1" end="10" step="1">
  <c:out value="${i}" />
  <br />
</c:forEach>

The output I am getting is:

${i} 
${i} 
${i} 
${i} 
${i} 
${i} 
${i} 
${i} 
${i} 
${i} 

I cant work out why the forEach loop is working but the output is not working. Any help any one could give would be great.

Answer

RHSeeger picture RHSeeger · Apr 27, 2009

I know it's supposed to be on by default, but I run across pages now and again (or even the same page that changes behavior) where the EL processing doesn't happen. Adding the following to the top of any such pages should resolve the issue:

<%@ page isELIgnored="false" %> 

I add it to every page because it doesn't hurt, and I still don't know the root cause that occasionally causes a page to stop interpreting the EL expressions.