How to make websphere 8.5 use mojarra not myfaces

北慕城南 提交于 2019-11-26 18:32:58

问题


i've a JSF2 (Richfaces 4.1.0) project running in eclipse. I'm trying to run it on WAS 8.5 using mojarra jsf implementation (2.2.0). Then lib are provided with maven but the server seems to override them since in console i can read that Myfaces as been loaded.

i'm wondering why WAS act like this ? how to make the project use mojarra without using shared libs in was admin console ?

this is maven relevant portion of code :

    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>2.2.0</version>
    </dependency>

    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>2.2.0</version>
    </dependency>

    <dependency>
        <groupId>javax.faces</groupId>
        <artifactId>javax.faces-api</artifactId>
        <version>2.2</version>
    </dependency>

    <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.faces</artifactId>
        <version>2.2.0</version>
    </dependency>

thanks in advance


回答1:


I wrote this blog to demonstrate how to make websphere 8.5 use mojarra not myfaces.

  1. Add the Mojarra listener to the required web.xml file. <listener><listener-class>com.sun.faces.config.ConfigureListener</listener-class></listener>
  2. Add the Mojarra JSF implementation, which are javax.faces-2.1.24.jar, jsf-api-2.1.24.jar and jsf-impl-2.1.24.jar, to the Environment > Shared Libraries.
    • javax.faces-2.1.24.jar (GroupId: org.glassfish)
    • jsf-api-2.1.24.jar (GroupId: com.sun.faces)
    • jsf-impl-2.1.24.jar (GroupId: com.sun.faces)
  3. After configuration shared libraries, the Websphere server must be Restart.
  4. After deploy your project, at the Enterprise Applications > staaec-web-1_0_10-SNAPSHOT_war(your project) > Class loader. Class loader order must be select (Classes loaded with local class loader first (parent last))
  5. For reference shared libraries to your project, you must go to Enterprise Applications > staaec-web-1_0_10-SNAPSHOT_war > Shared library references > Shared Library Mapping for mapping shared libraries to your project.
  6. Start your application.



回答2:


Check this page Configuring JavaServer Faces implementation. It explains in details what you have to configure (basically isolated shared library and configure JSF settings)



来源:https://stackoverflow.com/questions/24258561/how-to-make-websphere-8-5-use-mojarra-not-myfaces

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