如何在WildFly上安装JSF 2.3(javax.faces.jar)的一个jar变体 [英] How to install one jar variant of JSF 2.3 (javax.faces.jar) on WildFly

查看:204
本文介绍了如何在WildFly上安装JSF 2.3(javax.faces.jar)的一个jar变体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的应用程序上使用JSF 2.3,但是WildFly使用2.2的2 JAR变体.

I want to use the JSF 2.3 on my application, but WildFly uses the 2 JAR variant for 2.2.

Oracle在这里说 https://javaserverfaces.java.net/2.3/download.html不会发布2.3 2 JAR版本.

Oracle said here https://javaserverfaces.java.net/2.3/download.html that won't release a 2.3 2 JAR variant.

推荐答案

以下是手动过程:

  1. 使用ZIP工具提取javax.faces.jar.您将获得3个文件夹comjavaxMETA-INF.

  1. Extract javax.faces.jar with a ZIP tool. You'll get 3 folders com, javax and META-INF.

使用ZIP工具将comMETA-INF文件夹打包到jsf-impl.jar中.

Pack com and META-INF folders into jsf-impl.jar with a ZIP tool.

然后,删除MANIFEST.MFMETA-INF 除外中的所有文件/子文件夹.

Then, delete all files/subfolders in META-INF except of MANIFEST.MF.

使用ZIP工具将javaxMETA-INF文件夹打包到jsf-api.jar中.

Pack javax and META-INF folders into jsf-api.jar with a ZIP tool.

使用这些JAR继续此处:升级JSF/Mojarra在JBoss AS/EAP/WildFly中.

Continue here with those JARs: Upgrade JSF / Mojarra in JBoss AS / EAP / WildFly.


对于感兴趣的人,JBoss AS和WildFly在内部将基于Java EE的API和impl文件进行模块化分离.仍然需要分开的JAR文件jsf-api.jarjsf-impl.jar.原因并不是真正的技术问题,而只是一项额外的服务,可以迫使开发人员针对正确的库进行编程.在编译时(通常是通过IDE集成的插件将其添加到构建路径"中)仅公开API模块.这应该避免入门者意外地发现,导入和使用实现类,例如com.sun.faces.*包中的实现类.


For the interested, JBoss AS and WildFly has internally a modular separation of Java EE based API and impl files. The separated JAR files jsf-api.jar and jsf-impl.jar are still needed. The reason is not really technical, but just an extra service to force developers programming against the right libraries. Only the API modules are exposed during compile time (usually, via the IDE-integrated plugin which adds them to "build path"). This should avoid starters accidentally finding, importing and using implementation classes such as those in com.sun.faces.* package.

自1.x版开始,JSF实现Mojarra由两个JAR文件组成:jsf-api.jarjsf-impl.jar. API JAR包含javax.faces.*类,而实现JAR包含com.sun.faces.*类.由于构建系统的更改符合Java EE Maven规则,因此API和实现类都合并到单个javax.faces.jar文件中,另请参见

Already since version 1.x, the JSF implementation Mojarra was composed of two JAR files: jsf-api.jar and jsf-impl.jar. The API JAR contained the javax.faces.* classes and the implementation JAR contained the com.sun.faces.* classes. Since the change of the build system conform Java EE Maven rules, both the API and implementation classes were merged into a single javax.faces.jar file, see also issue 2028 (started with Mojarra 2.1.6 at Dec 2011). Since Mojarra 2.3, the separated JAR files are not built anymore.

这篇关于如何在WildFly上安装JSF 2.3(javax.faces.jar)的一个jar变体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆