如何更新GlassFish中的Mojarra版本 [英] How to update Mojarra version in GlassFish
问题描述
我想更新我的JSF应用程序以使用Mojarra版本2.1.8。我将这些行添加到WAR包的POM文件中:
< dependency>
< groupId> org.glassfish< / groupId>
< artifactId> javax.faces< / artifactId>
< version> 2.1.8< / version>
< /依赖关系>
我还添加了JSF存储库。我的软件包是用Mojarra 2.1.8版本成功构建的。但是当我打开GlassFish日志时,我发现部署了Mojarra版本2.1.6。我错过了什么?我是否需要对GlassFish服务器进行一些配置?
GlassFish本身已经包含JSF捆绑包,默认情况下,classloading的优先级高于webapp捆绑包的优先级。您基本上需要告诉GlassFish使用webapp绑定的JSF。
编辑webapp的 /WEB-INF/glassfish-web.xml
/WEB-INF/sun-web.xml
如果您使用的是第一个GF3版本)添加以下两项: < class-loader delegate =false/>
< property name =useBundledJsfvalue =true/>
然后,GlassFish将使用捆绑的JSF webapp。
$ b $另外,如果您对GlassFish具有完全的管理控制权,那么您也可以将它复制到
/ glassfish / modules
目录中,替换旧版本,以便它申请所有的webapps。 I want to update my JSF application to use Mojarra version 2.1.8. I added these lines into the POM file of the WAR package:
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.1.8</version>
</dependency>
I also added the JSF repository. I package is build successfully with the Mojarra version 2.1.8. But when I open the GlassFish log I see that there is a Mojarra version 2.1.6 deployed. What am I missing? Do I need to make some configuration into the GlassFish server?
GlassFish itself already ships with JSF bundled which get by default classloading precedence over the one bundled in the webapp. You basically need to tell GlassFish to use the webapp bundled JSF instead.
Edit the webapp's /WEB-INF/glassfish-web.xml
(or /WEB-INF/sun-web.xml
if you're using one of the first GF3 versions) to add the following two entries:
<class-loader delegate="false" />
<property name="useBundledJsf" value="true" />
GlassFish will then use the webapp bundled JSF instead.
Alternatively, if you have full admin control over GlassFish, then you can also copy it in the /glassfish/modules
directory, replacing the older version, so that it get applied on all webapps.
这篇关于如何更新GlassFish中的Mojarra版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!