[jboss-user] [JBoss Seam] - Re: Using facelets in .xml files

utiba_davidr do-not-reply at jboss.com
Tue Jun 26 20:18:28 EDT 2007


The following defines what file extension to look up:

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

And the following defined what extension to provide in the URL to match the .xhtml file:

    <filter-mapping>
  |         <filter-name>ajax4jsf</filter-name>
  |         <url-pattern>*.seam</url-pattern>
  |     </filter-mapping>

Based on this, it would appear that you can have multiple definitions for the URL extension to map as it's a filter. But you can only map these to one extension to look up - unless you do some fancy stuff like overload the ViewHandler (http://www.nabble.com/mixing-clay-full-html-and-full-xml-views-t2070241.html).

So, to make it prettier; Define two entry point extension to provide in the URL to match the .xhtml file:


  |     <filter-mapping>
  |         <filter-name>ajax4jsf</filter-name>
  |         <url-pattern>*.seam</url-pattern>
  |     </filter-mapping>
  | 
  |     <filter-mapping>
  |         <filter-name>ajax4jsf</filter-name>
  |         <url-pattern>*.xml</url-pattern>
  |     </filter-mapping>
  | 
  |    <context-param>
  |       <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
  |       <param-value>.xhtml</param-value>
  |    </context-param>
  | 

Then make a request to http://localhost:8080/context/goals.xml which will render a file named "goals.xhtml".


Cheers,

David

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057922#4057922

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057922



More information about the jboss-user mailing list