JSF 2.0 How to use Apache Myfaces with Glassfish V3
I am trying to use Myfaces with Glassfish but its not working. I have made sure myfaces-api and myfaces-i开发者_如何学编程mpl are the JSF runtimes deployed with my application but Glassfish still runs the application with the mojarra version.
I was thinking classes in the lib folder supercede those in the application sever.
If I remove the jsf-api and jsf-impl from the modules folder in glassfish, I get a an error on startup with some OSGI noise.
What is the recommeded way of using myfaces for ann application deployed with glassfish?
Ok, figured it out.
Solved by declaring this in glassfish-web.xml
<glassfish-web-app error-url="">
<class-loader delegate="false"/>
<property name="useBundledJsf" value="true"/>
</glassfish-web-app>
You can also use the following in the sun-web.xml
<sun-web-app>
<class-loader delegate="false"/>
<property name="useMyFaces" value="true"/>
</sun-web-app>
精彩评论