You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by John Ruffin <jr...@achfood.com> on 2006/06/08 19:22:49 UTC

MyFacesExtensionsFilter?

<!-- extension mapping for serving page-independent resources (javascript,
stylesheets, images, etc.)  -->
<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>

I not sure what this does.  Should the <url-pattern> be specific to my
resources(javascript, stylesheets, images, etc)?  Is this for internal
myFaces workings?
--
View this message in context: http://www.nabble.com/MyFacesExtensionsFilter--t1756467.html#a4776929
Sent from the MyFaces - Users forum at Nabble.com.


Re: MyFacesExtensionsFilter?

Posted by John Ruffin <jr...@achfood.com>.
I just emailed files you requested.

I'm using tomahawk 1.1.4.  You'll notice I changed my extensions from .jsf
to .faces - per recommendations on this thread.

I'll post the relevant parts here:

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

    <context-param>
		<description>State saving method: "client" or "server" (= default)
            See JSF Specification 2.5.3</description>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
    </context-param>
    
    <context-param>
					<param-name>
					org.apache.myfaces.SERIALIZE_STATE_IN_SESSION</param-name>
					<param-value>false</param-value>
	</context-param>

    <context-param>
        <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
        <param-value>true</param-value>
    </context-param>

    <context-param>
        <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
        <param-value>false</param-value>
    </context-param>

    <context-param>
        <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
        <param-value>true</param-value>
    </context-param>

    <context-param>
        <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
        <param-value>true</param-value>
    </context-param>
 
    
    <context-param>
		<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
		<param-value>messages</param-value>
	</context-param>
	
	<!-- Jruff, find * the applicationContext*.xml docs -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext*.xml</param-value>
    </context-param>

 <!-- Spot to find the tiles definitions -->    
    <context-param>
    	<param-name>tiles-definitions</param-name>
    	<param-value>/WEB-INF/tiles-defs.xml</param-value>
    </context-param>    

    <filter>
        <filter-name>SpringHibernateFilter</filter-name>
       
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
        <init-param>
          <param-name>sessionFactoryBeanName</param-name>
          <param-value>jruffinSF</param-value>
        </init-param>
    </filter>

<filter>
	<filter-name>MyFacesExtensionsFilter</filter-name>

<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
    <init-param>
        <param-name>maxFileSize</param-name>
        <param-value>20m</param-value>
    </init-param>
</filter>

<!-- extension mapping for adding <script/>, <link/>, and other resource
tags to JSF-pages  -->
<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>*.jsp</url-pattern>
</filter-mapping>

<!-- extension mapping for serving page-independent resources (javascript,
stylesheets, images, etc.)  -->
<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>	
	      
      <filter-mapping>
        <filter-name>SpringHibernateFilter</filter-name>
        <url-pattern>*.jsp</url-pattern>
    </filter-mapping>
    
	<listener>
       
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <listener>
       
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
    </listener>
    
    <!-- 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>

    <!-- Faces Servlet Mapping -->

    <!-- virtual path mapping -->
    <!--
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    -->

    <!-- extension mapping -->
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.faces</url-pattern>
    </servlet-mapping>

    <!-- Welcome files -->

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>

</web-app>


--
View this message in context: http://www.nabble.com/MyFacesExtensionsFilter--t1756467.html#a4866245
Sent from the MyFaces - Users forum at Nabble.com.


Re: MyFacesExtensionsFilter?

Posted by masiar ighani <mi...@metzler.com>.
Hallo John,
i have exactly the same problem configuring the extension filter with tiles.

could you please mail me your complete working web.xml and faces-config
file? Which versions of myfaces and tomahawk are you using? I have
myfaces-1.1.3 and tomahawk 1.1.2.
I already changed the url-mapping of the filter to *.jsp but still this
annoying exception is thrown.

Best regards,
masiar
--
View this message in context: http://www.nabble.com/MyFacesExtensionsFilter--t1756467.html#a4860708
Sent from the MyFaces - Users forum at Nabble.com.


Re: MyFacesExtensionsFilter?

Posted by Matthias Wessendorf <ma...@apache.org>.
I think the .jsf is reserved for reasons like that (not sure)
I prefere .faces for virtual mapping.

-Matthias

On 6/8/06, Adam Brod <AB...@intralinks.com> wrote:
>
>
> I have seen some Sun documentation where they are trying to recommend
> ".jsf" as a new file extension for jsp files that contain JSF components
> (just like they recommend the .jspf extension for jsps that are fragments).
>  That of course is very confusing since many people use the .jsf as a
> virutal mapped extension in their webapps.
>
> Ugh.
>
> We use .faces since it is easy to diambiguate from .jsp.
> *
> Adam Brod**
> Product Development Team*
>
>  *John Ruffin <jr...@achfood.com>*
>
> 06/08/2006 01:57 PM  Please respond to
> "MyFaces Discussion" <us...@myfaces.apache.org>
>
>   To
> users@myfaces.apache.org  cc
>
>  Subject
> Re: MyFacesExtensionsFilter?
>
>
>
>
>
>
>
> That's why they pay you the big buck$ :-).  You are correct, I changed it
> to
> .jsp from .jsf and it worked.
>
> The reference page needs to be updated - it has .jsf - I copied from that
> page.
>
> <filter-mapping>
>    <filter-name>MyFacesExtensionsFilter</filter-name>
>    <url-pattern>*.jsp</url-pattern>
> </filter-mapping>
> --
> View this message in context:
> http://www.nabble.com/MyFacesExtensionsFilter--t1756467.html#a4777515
> Sent from the MyFaces - Users forum at Nabble.com.
>
>  Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.
>
>


-- 
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: MyFacesExtensionsFilter?

Posted by Adam Brod <AB...@intralinks.com>.
I have seen some Sun documentation where they are trying to recommend 
".jsf" as a new file extension for jsp files that contain JSF components 
(just like they recommend the .jspf extension for jsps that are 
fragments).  That of course is very confusing since many people use the 
.jsf as a virutal mapped extension in their webapps.

Ugh. 

We use .faces since it is easy to diambiguate from .jsp.

Adam Brod
Product Development Team


John Ruffin <jr...@achfood.com> 
06/08/2006 01:57 PM
Please respond to
"MyFaces Discussion" <us...@myfaces.apache.org>


To
users@myfaces.apache.org
cc

Subject
Re: MyFacesExtensionsFilter?







That's why they pay you the big buck$ :-).  You are correct, I changed it 
to
.jsp from .jsf and it worked.

The reference page needs to be updated - it has .jsf - I copied from that
page.

<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>*.jsp</url-pattern>
</filter-mapping>
--
View this message in context: 
http://www.nabble.com/MyFacesExtensionsFilter--t1756467.html#a4777515
Sent from the MyFaces - Users forum at Nabble.com.


Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.

Re: MyFacesExtensionsFilter?

Posted by John Ruffin <jr...@achfood.com>.
That's why they pay you the big buck$ :-).  You are correct, I changed it to
.jsp from .jsf and it worked.

The reference page needs to be updated - it has .jsf - I copied from that
page.

<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>*.jsp</url-pattern>
</filter-mapping>
--
View this message in context: http://www.nabble.com/MyFacesExtensionsFilter--t1756467.html#a4777515
Sent from the MyFaces - Users forum at Nabble.com.


Re: MyFacesExtensionsFilter?

Posted by Matthias Wessendorf <ma...@apache.org>.
John-

the suffix should be .jsp since your pages are described in there.

.faces (better than .jsf IMO) is *only* for the FacesServlet.
Each request (for instance foo.faces is mapped to a physical file
foo.jsp) goes via FacesServlet through the JSF infrastructure.

-Matthias

On 6/8/06, John Ruffin <jr...@achfood.com> wrote:
>
> Thanks for the reply Mario.  I was just looking through the source and found
> that "it is" a special url - so keep it as is - not specific to my
> resources.
>
> I do use *.jsf in the mapping:
>     <context-param>
>                 <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
>                 <param-value>.jsf</param-value>
>         </context-param>
> ...
>     <servlet-mapping>
>         <servlet-name>Faces Servlet</servlet-name>
>         <url-pattern>*.jsf</url-pattern>
>     </servlet-mapping>
>
> Here is my next question: on the reference page it mentions you can use
> either <servlet name> or <url -pattern>.  Is that accurate?  I tried:
> <!-- extension mapping for adding <script/>, <link/>, and other resource
> tags to JSF-pages  -->
> <filter-mapping>
>     <filter-name>MyFacesExtensionsFilter</filter-name>
>     <url-pattern>*.jsf</url-pattern>
> </filter-mapping>
>
> --
> View this message in context: http://www.nabble.com/MyFacesExtensionsFilter--t1756467.html#a4777266
> Sent from the MyFaces - Users forum at Nabble.com.
>
>


-- 
Matthias Wessendorf
Aechterhoek 18
48282 Emsdetten
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com

Re: MyFacesExtensionsFilter?

Posted by John Ruffin <jr...@achfood.com>.
Thanks for the reply Mario.  I was just looking through the source and found
that "it is" a special url - so keep it as is - not specific to my
resources.

I do use *.jsf in the mapping:
    <context-param>
		<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
		<param-value>.jsf</param-value>
	</context-param>
...
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>

Here is my next question: on the reference page it mentions you can use
either <servlet name> or <url -pattern>.  Is that accurate?  I tried:
<!-- extension mapping for adding <script/>, <link/>, and other resource
tags to JSF-pages  -->
<filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>*.jsf</url-pattern>
</filter-mapping>

--
View this message in context: http://www.nabble.com/MyFacesExtensionsFilter--t1756467.html#a4777266
Sent from the MyFaces - Users forum at Nabble.com.


Re: MyFacesExtensionsFilter?

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi!
> <!-- extension mapping for serving page-independent resources (javascript,
> stylesheets, images, etc.)  -->
> <filter-mapping>
>     <filter-name>MyFacesExtensionsFilter</filter-name>
>     <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
> </filter-mapping>
>
> I not sure what this does.  Should the <url-pattern> be specific to my
> resources(javascript, stylesheets, images, etc)?  Is this for internal
> myFaces workings?
>   
No, this is correct.
The exception in one of your other thread just means that the "jsf
pages" are not covered - this is the *.jsf mapping, you access your
pages with *.jsf?
If not please change this mapping.

If the exception still coming up, this must be something TILES specific.
You can disable this check as described in
http://wiki.apache.org/myfaces/MyFacesExtensionsFilter though, I dont
know about other side effects then, I do not use TILES.


Ciao,
Mario