Can I still use MyFaces on JBoss 4.2 and JBoss 5.x?
The answer depends on what you mean by 'MyFaces'. There is some confusion between MyFaces Components and MyFaces Core.
The MyFaces components are made up of three projects - Tomahawk, Trinidad, and Tobago. THESE COMPONENT LIBRARIES SHOULD STILL RUN ON JSF 1.2 and JBoss 4.2/5.x.
If you want to use the MyFaces components you can continue to use them on JBoss 4.2 and JBoss 5.x.
The MyFaces Core is an implementation of the JSF specification. The current release implements JSF 1.1. For JBoss 4.2 and JBoss 5.x, we use the java.net JSF 1.2 implementation. The jars for MyFaces Core are myfaces-api.jar and myfaces-impl.jar. Plus there are various commons libraries that these two jars rely upon.
MyFaces Core only contains a subset of the features in java.net JSF 1.2. In general, anything that runs on MyFaces core should also run on the java.net JSF 1.2 implementation that is built into JBoss 4.2 and JBoss 5.x.
Using MyFaces Core with JBoss 4.2 and JBoss 5.x
There is no technical reason to use MyFaces Core on JBoss 4.2 or JBoss 5.x. But there are other reasons you might want to bundle it with your WAR. For instance, you might have an old JSF application that already uses MyFaces and you don't want to retest your app on a new JSF implementation. In that case, you can bundle the JSF implementation with your WAR and add this to your web.xml:
<context-param> <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name> <param-value>true</param-value> </context-param>
This will cause JBoss to ignore the built-in JSF implementation as long as you use the default classloader settings. If you declare a classloader in jboss-web.xml or set useJBossWebLoader = true then the above <context-param> will not work.
This feature does not apply to older versions of the Sun JSF impl. It only works for MyFaces. To run Sun's JSF 1.1 impl, you would need to surgically remove JSF from JBoss.
Note that use of this <context-param> is a community-only feature. It is not officially supported.