EL expressions are not evaluated in JBoss AS 4.2.2

删除回忆录丶 提交于 2019-12-11 08:06:58

问题


EL expressions are not evaluated in JBoss AS 4.2.2. I have web.xml declared conform the Servlet 2.4 spec.

<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

What needs to be done more in order to get EL to work in JBoss AS 4.2.2?


回答1:


Your web.xml root declaration looks fine.

Other causes to exclude:

  • Ensure that you don't have Servlet/JSP/EL libraries of a different servletcontainer make/version in your webapp's /WEB-INF/lib like servlet-api.jar, jsp-api.jar, el-api.jar, etc. More than often starters drop a copy of those files from unknown resource in there to overcome compilation problems, but that's the wrong approach!

  • Ensure that you don't have <%@page isELIgnored="true" %> in your JSPs.

  • Ensure that you don't have the following in your web.xml:

    <jsp-config>
        <el-ignored>true</el-ignored>
    <jsp-config>
    



回答2:


Add

<%@page isELIgnored="false" %> 

in your JSP.

I had a similar issue with Tomcat 6. Even though EL was not disabled globally (thru web.xml). I had to individually enable EL in my JSPs thru the above statement.



来源:https://stackoverflow.com/questions/6343557/el-expressions-are-not-evaluated-in-jboss-as-4-2-2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!