Can EL 2.2 capable JSF web applications be deployed to shared Tomcat 6 hosting environment?

☆樱花仙子☆ 提交于 2019-12-12 21:54:56

问题


I know that by replacing the el-api.jar in the lib folder of the Tomcat 6 directory with an EL 2.2 capable version that it is possible to utilize the power of EL 2.2 in Tomcat 6. See the following questions:

  • http://code2inspire.wordpress.com/2010/11/05/how-to-enable-el-2-2-on-tomcat-6/
  • http://www.javaplex.com/blog/for-jsf-2-how-to-enable-el-2-2-on-tomcat-6/

I have an app that I need to deploy for a public facing site and I want to do it as cheaply as possible. The best bargain for me would be to go with a Shared Tomcat hosting provider where you share a Tomcat instance with others, however the one I talked to doesn't offer Tomcat 7 environments.

It would be a lot more expensive and time consuming for me to setup a VPS to do this, so I was wondering if there is anyway I can swing this on Tomcat 6 without the ability to modify the lib directory?


回答1:


Use JBoss EL instead. It is EL 2.1 based, but offers the same enhancements as done in EL 2.2. Drop jboss-el.jar in /WEB-INF/lib and add the following to the web.xml:

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

No need to modify Tomcat's /lib. You only need to ensure that you're using Facelets instead of JSP.



来源:https://stackoverflow.com/questions/8661255/can-el-2-2-capable-jsf-web-applications-be-deployed-to-shared-tomcat-6-hosting-e

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