Making Glassfish respond to ajax request JSF 2

左心房为你撑大大i 提交于 2019-12-01 10:58:46

Glassfish as being a full Java EE implementation ships with a JSF implementation (Mojarra) already bundled. Glassfish will auto-load it before your webapp. But since you bundled a different JSF implementation (MyFaces) in your webapp, it will collide. Tomcat is a simple JSP/Servlet container and does not ship with JSF bundled so there's also nothing which will collide (until you drop some JSP/Servlet libraries of a different implementation/version in your webapp).

You have 2 options:

  1. Get rid of MyFaces libraries in your webapp. Your webapp will only not run on Tomcat anymore without changing Tomcat's shared classpath to include JSF libraries.

  2. Tell Glassfish to not load its bundled JSF implementation but to use the webapp-bundled JSF instead. Edit the /META-INF/sun-web.xml file in your webapp to contain the following lines:

    <class-loader delegate="false" />
    <property name="useBundledJsf" value="true" />
    
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!