首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

web项目上中EL无效

2012-10-27 
web项目下中EL无效Whether EL Evaluation is enabled or disabled depends on many things:if application

web项目下中EL无效

Whether EL Evaluation is enabled or disabled depends on many things:

if application server supports JSP 2.0 (Tomcat 5.0 and higher does)web.xml descriptor file... if declares (e.g. by not using web-app_2_4.xsd schema) that it uses Servet 2.3 spec or earlier, EL is disabled by default.JSP Configuration <el-ignored>Page directive isELIgnored (<%@ page isELIgnored=”true|false” %>)

(See JSP Spec 2.0, part JSP.3.3.2 for more details)

Simple way to check if EL is enabled/disabled is to use ${request} on your page. If you see '${request}' in output, EL is disabled. If you see something different, it is enabled.

You may want to change \$ (one backslash) to \\$ (two backslashes) to get \$ in output if you also use EL on your page.

If you see differences between local/remote server, their settings related to EL probably differ. Best what you can do is to 1) use JSP 2.0, Servlet 2.4 or later (enables EL), 2) run same web server on machines. (Btw, I suggest you upgrade Tomcat 5.0 to 5.5 at least).

热点排行