Difference between revisions of "JBoss JSF Richfaces"

From MPDLMediaWiki
Jump to navigation Jump to search
m
Line 40: Line 40:
*Two options for update to JSF 2.0:
*Two options for update to JSF 2.0:


** Without modification of JBoss libraries: JSF libraries (jsf-api.jar & jsf-impl. jar) must be included in WEB-INF/lib directory of the war file. Additionally, the following line must be set in web.xml:
** Without modification of JBoss libraries: Following instructions on: [http://aaron.ajexperience.com/2010/10/11/jboss-5-with-jsf-2-on-a-per-app-basis/]
 
JSF libraries (jsf-api.jar & jsf-impl.jar, jboss-faces.jar and jboss-mc-int-servlet.jar from JBoss 6) must be included in WEB-INF/lib directory of the war file. Additionally, the following lines must be set in web.xml:
  <context-param>
  <context-param>
   <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
   <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
   <param-value>true</param-value>
   <param-value>true</param-value>
  </context-param>
  </context-param>
!!!!Beware: The name of the JSF jar files must be exactly the same as in the JBoss deploy directory. This leads to a problem with Maven, which automatically adds the version number to the files.
<!-- JSF 2: this needs to be included to avoid an error message -->
<context-param>
  <param-name>com.sun.faces.injectionProvider</param-name>
  <param-value>org.jboss.web.jsf.integration.injection.JBossInjectionProvider</param-value>
</context-param>


* This blog also suggests to replace jboss-faces.jar and add other lines to web.xml: [http://aaron.ajexperience.com/2010/10/11/jboss-5-with-jsf-2-on-a-per-app-basis/]
* JBoss still logs version 1.2 at startup, but anyway JSF 2 seems to run
* Doesn't work for me, strange ClassNotFoundExceptions occur
INFO  [config] Initializing Mojarra (1.2_12-b01-FCS) for context '/digi_lifecycle'


** With modification of JBoss: Replace the two JSF libraries (jsf-api.jar & jsf-impl. jar) in /server/default/deploy/jbossweb.sar/jsf-libs with the ones of version 2. Beware that they must have the same filename. Leave jboss-faces.jar as it is.
 
** With modification of JBoss: Replace the two JSF libraries (jsf-api.jar & jsf-impl. jar) in /server/default/deploy/jbossweb.sar/jsf-libs with the ones of version 2. Beware that they must have the same filename. Leave jboss-faces.jar here as it is.
*This page suggests to also replace the jboss-faces.jar: [http://community.jboss.org/wiki/upgradejbossastojsf2] - Doesn't work for me strange ClassNotFoundExceptions occur
*This page suggests to also replace the jboss-faces.jar: [http://community.jboss.org/wiki/upgradejbossastojsf2] - Doesn't work for me strange ClassNotFoundExceptions occur


Line 92: Line 99:




*Problems: Errors like the following occur, but they do not seem to bother the application
*Problems with both configurations (with&without modifications of JBoss): Errors like the following occur, but they do not seem to bother the application
  SEVERE [compiler] Error Loading Library: vfszip:/C:/jboss/jboss-5.1.0.GA.JSF2/server/default/deploy/jbossweb.sar/jsf-libs/jsf-impl.jar/com/sun/faces/metadata/taglib/composite.taglib.xml
  SEVERE [compiler] Error Loading Library: vfszip:/C:/jboss/jboss-5.1.0.GA.JSF2/server/default/deploy/jbossweb.sar/jsf-libs/jsf-impl.jar/com/sun/faces/metadata/taglib/composite.taglib.xml


Line 100: Line 107:
*Currently, only milestone release is available, which still seems to be quite incomplete.
*Currently, only milestone release is available, which still seems to be quite incomplete.
*Many changes in names from version 3.3.3, no ready documentation yet.
*Many changes in names from version 3.3.3, no ready documentation yet.


=JBoss 6.0=
=JBoss 6.0=

Revision as of 08:21, 22 February 2011

JBoss 4.2.2[edit]

JSF 1.2[edit]

  • No problems as JBoss 4.2.x comes with built in JSF 1.2 libraries (Mojarra)

Richfaces 3.3.3[edit]

Required Dependencies:

<dependency>
  <groupId>org.richfaces.ui</groupId>
  <artifactId>richfaces-ui</artifactId>
  <version>3.3.3.Final</version>
</dependency>

<dependency>
  <groupId>org.richfaces.framework</groupId>
  <artifactId>richfaces-impl</artifactId>
  <version>3.3.3.Final</version>
</dependency>
  • If Facelets are required, use version 1.15 for compatibility with RichFaces 3.3.3
<dependency>
  <groupId>com.sun.facelets</groupId>
  <artifactId>jsf-facelets</artifactId>
  <version>1.1.15</version>
</dependency>	


JSF 2.0[edit]

  • not tested, presumably same as with JBoss 5.1


JBoss 5.1[edit]

JSF 1.2[edit]

  • No problems as JBoss 5.1 comes with built in JSF 1.2 libraries (Mojarra)
  • See #JBoss 4.2.2

JSF 2.0[edit]

  • JBoss 5.1 comes with built in JSF 1.2 libraries
  • Two options for update to JSF 2.0:
    • Without modification of JBoss libraries: Following instructions on: [1]

JSF libraries (jsf-api.jar & jsf-impl.jar, jboss-faces.jar and jboss-mc-int-servlet.jar from JBoss 6) must be included in WEB-INF/lib directory of the war file. Additionally, the following lines must be set in web.xml:

<context-param>
 <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
 <param-value>true</param-value>
</context-param>
<context-param>
  <param-name>com.sun.faces.injectionProvider</param-name>
  <param-value>org.jboss.web.jsf.integration.injection.JBossInjectionProvider</param-value>
</context-param>
  • JBoss still logs version 1.2 at startup, but anyway JSF 2 seems to run
INFO  [config] Initializing Mojarra (1.2_12-b01-FCS) for context '/digi_lifecycle'


    • With modification of JBoss: Replace the two JSF libraries (jsf-api.jar & jsf-impl. jar) in /server/default/deploy/jbossweb.sar/jsf-libs with the ones of version 2. Beware that they must have the same filename. Leave jboss-faces.jar here as it is.
  • This page suggests to also replace the jboss-faces.jar: [2] - Doesn't work for me strange ClassNotFoundExceptions occur
  • New Expression Language functionality (paramters in method calls etc.)cannot be used!

Richfaces 3.3.3[edit]

  • Richfaces 3.3.3.Final is partly JSF 2 compatible
  • Seperate richfaces-impl JSF 2 library is available, ui library stays the same as for JSF 1.2:

<dependency>

  <groupId>org.richfaces.ui</groupId>
  <artifactId>richfaces-ui</artifactId>
  <version>3.3.3.Final</version>
</dependency>

<dependency>
  <groupId>org.richfaces.framework</groupId>
  <artifactId>richfaces-impl-jsf2</artifactId>
  <version>3.3.3.Final</version>
</dependency>
  • Richfaces 3.3.3.Final is not compatible with Facelets 2, which is included in JSF 2 libraries. Thus, it has to be deactivated in web.xml:
<context-param>
  <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
  <param-value>true</param-value>
</context-param>
  • If Facelets is required, version 1.1.15 has to be used..
<dependency>
  <groupId>com.sun.facelets</groupId>
  <artifactId>jsf-facelets</artifactId>
  <version>1.1.15</version>
</dependency>	
  • ... and must be explicitely activated in faces-config:
<application>    
  <view-handler>
   com.sun.facelets.FaceletViewHandler
  </view-handler>
</application>


  • Problems with both configurations (with&without modifications of JBoss): Errors like the following occur, but they do not seem to bother the application
SEVERE [compiler] Error Loading Library: vfszip:/C:/jboss/jboss-5.1.0.GA.JSF2/server/default/deploy/jbossweb.sar/jsf-libs/jsf-impl.jar/com/sun/faces/metadata/taglib/composite.taglib.xml


Richfaces 4.0[edit]

  • Richfaces 4.0 is fully compatible with JSF 2
  • Currently, only milestone release is available, which still seems to be quite incomplete.
  • Many changes in names from version 3.3.3, no ready documentation yet.

JBoss 6.0[edit]

JSF 1.2[edit]

  • Not of interest

JSF 2[edit]

  • JBoss 6 comes with built-in JSF 2 libraries
  • Full support of new Expression Language and Java EE 6 specification

Richfaces 3.3.3[edit]

  • Same problems with facelets compatibility as described for #JBoss 5.1


Richfaces 4[edit]

  • Works fine, but currently no final version provided (see #JBoss 5.1)