这个问题又快又简单。
JBoss 5.1 开箱即用,支持 JSP 和 EL(表达式语言)2.1 以及 Servlet 2.5。
是否可以升级或破解它以使用 EL 2.2?
更新:
我尝试了 BalusC 的答案所述并收到以下错误:
2011-08-01 10:29:52,418 严重 [javax.enterprise.resource.webcontainer.jsf.config](主要)无法实例化 ExpressionFactory 'org.jboss.el.ExpressionFactoryImpl'
2011-08-01 10:29:52,441 严重 [javax.enterprise.resource.webcontainer.jsf.config](主要)部署期间出现严重错误:
com.sun.faces.config.ConfigurationException:容器的 JSP 版本似乎早于 2.1,并且无法找到 EL RI 表达式工厂 com.sun.el.ExpressionFactoryImpl。如果不使用 JSP 或 EL RI,请确保正确设置上下文初始化参数 com.sun.faces.expressionFactory。
我不确定这意味着什么或如何解决它。为什么认为有低于2.1的JSP版本?
This question is quick and simple.
JBoss 5.1 comes out of box supporting JSP and EL (Expression Language) 2.1 and Servlet 2.5.
Is it possible to upgrade or hack this to use EL 2.2?
UPDATE:
I tried what BalusC's answer stated and got the following error:
2011-08-01 10:29:52,418 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (main) Unable to instantiate ExpressionFactory 'org.jboss.el.ExpressionFactoryImpl'
2011-08-01 10:29:52,441 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (main) Critical error during deployment:
com.sun.faces.config.ConfigurationException: It appears the JSP version of the container is older than 2.1 and unable to locate the EL RI expression factory, com.sun.el.ExpressionFactoryImpl. If not using JSP or the EL RI, make sure the context initialization parameter, com.sun.faces.expressionFactory, is properly set.
I am not sure what this means or how to get around it. Why does it think there is a JSP version below 2.1?
发布评论
评论(1)
不,虽然替换库很简单,但您毕竟必须重新声明符合 Servlet 3.0 的
web.xml
才能使其正常工作。如果不将所有库替换为与 JBoss 6.0(Servlet 3.0 impl)中的库相同,JBoss 5.1(Servlet 2.5 impl)将无法识别这一点。将整个系统升级到 JBoss 6.0 会更容易。我知道您正在使用 JSF 2.0(在查看旧问题标签时)。如果唯一的功能需求是支持 JSF 支持 bean 操作方法调用,并像 EL 2.2 中那样使用参数,那么最好的选择是删除 JBoss-EL JAR 文件位于Web 应用程序的
/WEB-INF/lib
并将以下上下文参数添加到 Web 应用程序的web.xml
中(假设您使用的是 Mojarra)。不,不可能在 JBoss 级别配置它。您确实必须在网络应用程序级别执行此操作。有关 JBoss EL(它是在 EL 中调用带有参数的方法的发起者)的更多信息,查看 Seam 文档第 34 章。
No, while replacing the libs is trivial, you'd after all have to redeclare the
web.xml
conform Servlet 3.0 to get it to work. This ain't going to be recognized by JBoss 5.1 (which is a Servlet 2.5 impl) without replacing all of its libraries to be the same as the ones in JBoss 6.0 (which is a Servlet 3.0 impl). It would be easier to just upgrade the whole thing to JBoss 6.0.I understand that you're using JSF 2.0 (when looking at the old question tags). If the sole functional requirement is to support JSF backing bean action method invocations with arguments like as possible in EL 2.2, then your best bet is to drop a copy of JBoss-EL JAR file in
/WEB-INF/lib
of your webapp and add the following context param to your webapp'sweb.xml
, assuming that you're using Mojarra.No, it's not possible to configure it at JBoss level. You'd really have to do it at webapp level. For more about JBoss EL (which was the initiator behind invoking methods with arguments in EL), check chapter 34 of the Seam documentation.