Details
-
Feature Request
-
Resolution: Won't Do
-
Optional
-
None
-
JBossAS-4.0.4RC1
-
None
-
Documentation (Ref Guide, User Guide, etc.)
-
0
-
0%
Description
Currently, the JSF implementation that ships with JBoss requires the application developer to do a fair amount of configuration in the web.xml file. These include adding the MyFaces servlet context listener like this:
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
JSF applications also requre the web.xml to include the FacesServlet and one or more servlet mappings.
See http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossFaces
By adding the listener, the FacesServlet, and the servlet mappings to deploy\jbossweb-tomcat55.sar\conf\web.xml we can eliminate this extra configuration. At the end of the day, JSF is moved to the same conceptual level as JSP. That is, you simply drop your JSF application into a WAR directory and it runs without any extra configuration.
To accomplish this, we must create a JBoss version of the MyFaces StartupServletContextListener. It also requres that we extend the MyFaces org.apache.myfaces.webapp.webxml.WebXml class. This class contains the servlet mappings for the FacesServlet. JSF needs to know the mappings so it can properly render URLs. We place an object of this class in application scope where MyFaces knows to find it.
By default, JSF applications will use extension mappings for the FacesServlet. The extensions used will be *.jsf and *.faces:
<servlet-mapping>
<servlet-name>JBoss Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>JBoss Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
If an application developer wants to configure his application using entries in his own web.xml, then it will replace the WebXml object in application scope and the applicaiton will work just as it does in JBoss AS 4.0.3.
Attachments
Issue Links
- blocks
-
JBAS-2595 JMX Resolver for JSF
- Closed