JSP:不计算 EL 表达式 [英] JSP: EL expression is not evaluated

查看:45
本文介绍了JSP:不计算 EL 表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在 Tomcat 5.5 上运行的 JSP 页面.我有以下代码:

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>

我得到的输出是:

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

我不知道为什么 forEach 循环有效但输出无效.任何人可以提供的任何帮助都会很棒.

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.

推荐答案

我知道它应该在默认情况下打开,但我时不时地跨页面(甚至是改变行为的同一页面)运行 EL 处理不不会发生将以下内容添加到任何此类页面的顶部应该可以解决问题:

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" %> 

我把它添加到每个页面,因为它不会受到伤害,但我仍然不知道偶尔导致页面停止解释 EL 表达式的根本原因.

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.

这篇关于JSP:不计算 EL 表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆