Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
521 views
in Technique[技术] by (71.8m points)

jakarta ee - Upgrade JBoss 5.1 from EL 2.1 to EL 2.2?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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's web.xml, assuming that you're using Mojarra.

<context-param>     
    <param-name>com.sun.faces.expressionFactory</param-name>
    <param-value>org.jboss.el.ExpressionFactoryImpl</param-value>   
</context-param>

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...