5 Replies Latest reply on Jul 14, 2007 9:48 PM by Jason Long

    getting rid of the .seam extension

    Alex Grönholm Novice

      Is it possible to configure web.xml so that I could use the .xhtml extension directly instead of .seam? The Seam Blog example uses /seam/* which I like even less. At the moment, if I use the .xhtml extension directly, I just get the raw contents of the file.
      Another related problem is getting my rss.xml working without having to resort to the /seam/* servlet mapping. Any ideas?

        • 2. Re: getting rid of the .seam extension
          Jason Long Master

           

          <?xml version="1.0" encoding="UTF-8"?>
          <web-app version="2.5"
           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">
          
           <!-- Ajax4jsf (must come first!) -->
           <filter>
           <display-name>Ajax4jsf Filter</display-name>
           <filter-name>ajax4jsf</filter-name>
           <filter-class>org.ajax4jsf.Filter</filter-class>
           </filter>
           <filter-mapping>
           <filter-name>ajax4jsf</filter-name>
           <url-pattern>*.xhtml</url-pattern>
           </filter-mapping>
           <context-param>
           <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
           <param-value>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</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.web.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.ResourceServlet</servlet-class>
           </servlet>
          
           <servlet-mapping>
           <servlet-name>Seam Resource Servlet</servlet-name>
           <url-pattern>/seam/resource/*</url-pattern>
           </servlet-mapping>
          
          
           <!-- JSF and Facelets -->
           <context-param>
           <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
           <param-value>server</param-value>
           </context-param>
           <context-param>
           <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
           <param-value>.xhtml</param-value>
           </context-param>
           <context-param>
           <param-name>facelets.DEVELOPMENT</param-name>
           <param-value>true</param-value>
           </context-param>
          
           <!-- Faces Servlet -->
           <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>*.xhtml</url-pattern>
           </servlet-mapping>
          
           <!-- JSF RI -->
           <listener>
           <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
           </listener>
          
           <!-- Welcome files -->
           <welcome-file-list>
           <welcome-file>index.xhtml</welcome-file>
           </welcome-file-list>
          
          </web-app>


          • 3. Re: getting rid of the .seam extension
            Alex Grönholm Novice

            My problem has nothing to do with MIME types. Please read the problem description more carefully.

            • 4. Re: getting rid of the .seam extension
              Alex Grönholm Novice

              Replied too quickly it seems.
              Changing the URL pattern to .xhtml gets rid of the .seam extension, but doesn't solve the rss problem.

              • 5. Re: getting rid of the .seam extension
                Jason Long Master

                You could use URL rewrite.