web.xml 7.02 KB
<?xml version="1.0" encoding="UTF-8" ?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5">

    <!-- For cluster, add distributable as the first child element, seam_reference-35.1.2 -->
    <!-- <distributable /> -->

    <display-name>${app.display.name}</display-name>

    <error-page>
        <error-code>404</error-code>
		<location>/404.xhtml</location>
    </error-page>

    <!-- RichFaces  -->
    <context-param>
        <param-name>org.richfaces.SKIN</param-name>
        <param-value>glassX</param-value>
    </context-param>

    <!-- Suppress spurious stylesheets -->
    <context-param>
        <param-name>org.richfaces.CONTROL_SKINNING</param-name>
        <param-value>disable</param-value>
    </context-param>

    <context-param>
        <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
        <param-value>disable</param-value>
    </context-param>

    <!-- Change load strategy to DEFAULT to disable sending scripts/styles as packs -->
    <context-param>
        <param-name>org.richfaces.LoadStyleStrategy</param-name>
        <param-value>DEFAULT</param-value>
    </context-param>

    <context-param>
        <param-name>org.richfaces.LoadScriptStrategy</param-name>
        <param-value>DEFAULT</param-value>
    </context-param>

    <!-- Seam -->
    <listener>
        <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
    </listener>

    <filter>
        <filter-name>Seam Filter</filter-name>
        <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>Seam Filter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <servlet>
        <servlet-name>Seam Resource Servlet</servlet-name>
        <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>Seam Resource Servlet</servlet-name>
        <url-pattern>/seam/resource/*</url-pattern>
    </servlet-mapping>

    <!-- Facelets -->

    <!-- Facelets development mode (disable in production) -->
    <context-param>
        <param-name>facelets.DEVELOPMENT</param-name>
        <param-value>${app.debug}</param-value>
    </context-param>

    <context-param>
        <description>
            Strip html comments from the page before it is rendred - meaning that you will
            no longer be bugged down by EL evaluating expressions inside a comment tag
        </description>
        <param-name>facelets.SKIP_COMMENTS</param-name>
        <param-value>true</param-value>
    </context-param>

    <!-- SiA source code, ch11 -->
    <!--
     <context-param>
         <description>
             If the view cannot be found in the session on a JSF postback, rebuild
             the view again before executing the Restore View phase. This step
             prevents "stale" public form pages. Enable this feature if you need it.
         </description>
         <param-name>facelets.BUILD_BEFORE_RESTORE</param-name>
         <param-value>false</param-value>
     </context-param>
     -->

    <!-- JSF -->
    <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>
    </context-param>

    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.seam</url-pattern>
    </servlet-mapping>

    <!-- Not shure if this is needed
     <context-param>
         <description>
             JSF 1.2 detects the ViewHandler/StateManager version from the
             faces-config.xml DTD/XML schema name. The faces-config.xml files in
             the RichFaces JARs use the JSF 1.1 DTDs, causing JSF to use 1.1
             behavior. Setting this flag to false ignores the version of the DTD
             used in these files, thus ensuring that JSF uses 1.2 behavior.

             One of the critical improvements in JSF 1.2 is that it throws a
             ViewExpiredException on a session timeout.

             See http://jira.jboss.com/jira/browse/RF-2294 and
             http://lists.jboss.org/pipermail/seam-dev/2008-February/000024.html.
         </description>
         <param-name>com.sun.faces.disableVersionTracking</param-name>
         <param-value>true</param-value>
     </context-param>
     -->

    <!-- URL Rewrite Filter - declare after seam filter -->
    <!--
         There are two rewrite options in Seam, you can choose to either use the org.tuckey
         UrlRewriteFilter or the native Seam rewriting. You should not attempt to use both.
         The native Seam rewriting does not use the org.tuckey rewrite engine at all.
         If you are going to use Seam's native rewriting, then remove the org.tuckey
         UrlRewriteFilter from web.xml and nuke the urlrewrite.xml file.
         With Seam 2.1 or newer it is recommend to use Seam's native rewrite engine.
      -->
    <!--
     <filter>
         <filter-name>UrlRewriteFilter</filter-name>
         <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
     </filter>

     <filter-mapping>
         <filter-name>UrlRewriteFilter</filter-name>
         <url-pattern>/*</url-pattern>
     </filter-mapping>
     -->

    <session-config>
        <session-timeout>10</session-timeout>
    </session-config>

    <!-- -->
    <security-constraint>
        <display-name>Restrict raw XHTML Documents</display-name>
        <web-resource-collection>
            <web-resource-name>XHTML</web-resource-name>
            <url-pattern>*.xhtml</url-pattern>
        </web-resource-collection>
        <auth-constraint/>
    </security-constraint>


    <!--JSFUnit-->
    <filter>
        <filter-name>JSFUnitFilter</filter-name>
        <filter-class>org.jboss.jsfunit.framework.JSFUnitFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>JSFUnitFilter</filter-name>
        <servlet-name>ServletTestRunner</servlet-name>
    </filter-mapping>

    <filter-mapping>
        <filter-name>JSFUnitFilter</filter-name>
        <servlet-name>ServletRedirector</servlet-name>
    </filter-mapping>

    <servlet>
        <servlet-name>ServletRedirector</servlet-name>
        <servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
    </servlet>

    <servlet>
        <servlet-name>ServletTestRunner</servlet-name>
        <servlet-class>org.apache.cactus.server.runner.ServletTestRunner</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>ServletRedirector</servlet-name>
        <url-pattern>/ServletRedirector</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>ServletTestRunner</servlet-name>
        <url-pattern>/ServletTestRunner</url-pattern>
    </servlet-mapping>

</web-app>