Here is a web.xml configuration excerpt from a project of mine which uses
tomahawk and myfaces - this should help you:

<!-- Extensions Filter -->
 <filter>
  <filter-name>MyFacesExtensionsFilter</filter-name>

<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
  <init-param>
   <description>Set the size limit for uploaded files.
                Format: 10 - 10 bytes
                        10k - 10 KB
                        10m - 10 MB
                        1g - 1 GB</description>
   <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>
  <!-- servlet-name must match the name of your
javax.faces.webapp.FacesServlet entry -->
  <servlet-name>Faces Servlet</servlet-name>
 </filter-mapping>
 <!-- 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>
 <!-- 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>

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

Regards,
Jakob

2010/3/23 Jakob Korherr <[email protected]>

> OK, sorry..
>
> But this web.xml includes
>
>
> <filter-mapping>
>      <filter-name>MyFacesExtensionsFilter</filter-name>
>      <url-pattern>/faces/*</url-pattern>
>  </filter-mapping>
>
> but it should have
>
>
> <filter-mapping>
> <filter-name>MyFacesExtensionsFilter</filter-name>
> <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
> </filter-mapping>
>
> You could also try adding both...
>
> Regards,
> Jakob
>
>
> 2010/3/23 Fabio F. <[email protected]>
>
>> I've read and read this page tens of times those days...
>>
>>
>> No, I've modified only the line in the filter config, this is definitely
>> my
>> web.xml:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns="
>> http://java.sun.com/xml/ns/javaee"; xmlns:web="
>> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"; xsi:schemaLocation="
>> http://java.sun.com/xml/ns/javaee
>> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"; id="WebApp_ID"
>> version="2.5">
>>  <display-name>telemarketing</display-name>
>>  <welcome-file-list>
>>    <welcome-file>index.html</welcome-file>
>>    <welcome-file>index.htm</welcome-file>
>>    <welcome-file>index.jsp</welcome-file>
>>    <welcome-file>default.html</welcome-file>
>>    <welcome-file>default.htm</welcome-file>
>>    <welcome-file>default.jsp</welcome-file>
>>  </welcome-file-list>
>>   <context-param>
>>    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
>>    <param-value>resources.application</param-value>
>>  </context-param>
>>  <context-param>
>>    <description>State saving method: 'client' or 'server' (=default). See
>> JSF Specification 2.5.2</description>
>>    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
>>    <param-value>server</param-value>
>>  </context-param>
>>  <context-param>
>>    <description>
>>    This parameter tells MyFaces if javascript code should be allowed in
>>    the rendered HTML output.
>>    If javascript is allowed, command_link anchors will have javascript
>> code
>>    that submits the corresponding form.
>>    If javascript is not allowed, the state saving info and nested
>> parameters
>>    will be added as url parameters.
>>    Default is 'true'</description>
>>    <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
>>    <param-value>true</param-value>
>>  </context-param>
>>  <context-param>
>>    <description>
>>    If true, rendered HTML code will be formatted, so that it is
>> 'human-readable'
>>    i.e. additional line separators and whitespace will be written, that do
>> not
>>    influence the HTML code.
>>    Default is 'true'</description>
>>    <param-name>org.apache.myfaces.PRETTY_HTML</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>
>>    <description>
>>    If true, a javascript function will be rendered that is able to restore
>> the
>>    former vertical scroll on every request. Convenient feature if you have
>> pages
>>    with long lists and you do not want the browser page to always jump to
>> the top
>>    if you trigger a link or button action that stays on the same page.
>>    Default is 'false'
>> </description>
>>    <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
>>    <param-value>true</param-value>
>>  </context-param>
>>  <servlet>
>>    <servlet-name>faces</servlet-name>
>>    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
>>    <load-on-startup>1</load-on-startup>
>>  </servlet>
>>  <servlet-mapping>
>>    <servlet-name>faces</servlet-name>
>>    <url-pattern>/faces/*</url-pattern>
>>  </servlet-mapping>
>>  <listener>
>>
>>
>> <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
>>  </listener>
>>  <context-param>
>>    <param-name>org.apache.myfaces.ERROR_HANDLER</param-name>
>>    <param-value>netwave.utils.ErrorHandler</param-value>
>>  </context-param>
>>  <filter>
>>       <filter-name>MyFacesExtensionsFilter</filter-name>
>>
>>
>> <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
>>      <init-param>
>>          <param-name>uploadMaxFileSize</param-name>
>>          <param-value>20m</param-value>
>>      </init-param>
>>  </filter>
>>   <filter-mapping>
>>      <filter-name>MyFacesExtensionsFilter</filter-name>
>>       <servlet-name>faces</servlet-name>
>>  </filter-mapping>
>>   <filter-mapping>
>>      <filter-name>MyFacesExtensionsFilter</filter-name>
>>       <url-pattern>/faces/*</url-pattern>
>>  </filter-mapping>
>>   <filter-mapping>
>>      <filter-name>MyFacesExtensionsFilter</filter-name>
>>       <url-pattern>*.jsf</url-pattern>
>>  </filter-mapping>
>>  <filter>
>>    <filter-name>CustomCharacterEncodingFilter</filter-name>
>>
>>  <filter-class>netwave.utils.CustomCharacterEncodingFilter</filter-class>
>>  </filter>
>>  <filter-mapping>
>>    <filter-name>CustomCharacterEncodingFilter</filter-name>
>>    <url-pattern>/*</url-pattern>
>>  </filter-mapping>
>>  <error-page>
>>
>>
>> <exception-type>javax.faces.application.ViewExpiredException</exception-type>
>>    <location>/session_expired.jsp</location>
>>  </error-page>
>> </web-app>
>>
>> I attach even my faces-config.xml (for the line message listener, the rest
>> I
>> don't think is useful):
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>> <faces-config
>>     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-facesconfig_1_2.xsd";
>>    version="1.2">
>>    <managed-bean>
>>        <managed-bean-name>BB_Aziende</managed-bean-name>
>>        <managed-bean-class>telemarketing.BB_Aziende</managed-bean-class>
>>        <managed-bean-scope>session</managed-bean-scope>
>>    </managed-bean>
>>    <navigation-rule>
>>        <display-name>login</display-name>
>>        <from-view-id>/login.jsp</from-view-id>
>>        <navigation-case>
>>            <from-outcome>login_ok</from-outcome>
>>            <to-view-id>/query.jsp</to-view-id>
>>        </navigation-case>
>>        <navigation-case>
>>            <from-outcome>login_ko</from-outcome>
>>            <to-view-id>/accessdenied.jsp</to-view-id>
>>        </navigation-case>
>>    </navigation-rule>
>>    <navigation-rule>
>>        <navigation-case>
>>            <from-outcome>exceptionView</from-outcome>
>>            <to-view-id>/session_expired.jsp</to-view-id>
>>        </navigation-case>
>>    </navigation-rule>
>>    <application>
>>        <message-bundle>netwave.GeneralMessages</message-bundle>
>>    </application>
>>    <application>
>>        <message-bundle>netwave.GeneralErrors</message-bundle>
>>    </application>
>>    <validator>
>>        <validator-id>checkvalidemail</validator-id>
>>
>>
>> <validator-class>netwave.utils.validators.Validator_Email</validator-class>
>>    </validator>
>>    <validator>
>>        <validator-id>checkvalidnumber</validator-id>
>>
>>
>> <validator-class>netwave.utils.validators.Validator_Integer</validator-class>
>>    </validator>
>>    <validator>
>>        <validator-id>checkvalidtext</validator-id>
>>
>> <validator-class>netwave.utils.validators.Validator_Text</validator-class>
>>    </validator>
>>    <validator>
>>        <validator-id>checkvalidfloat</validator-id>
>>
>>
>> <validator-class>netwave.utils.validators.Validator_Float</validator-class>
>>    </validator>
>>    <validator>
>>        <validator-id>checkvaliddate</validator-id>
>>
>> <validator-class>netwave.utils.validators.Validator_Date</validator-class>
>>    </validator>
>>    <validator>
>>        <validator-id>checkvalidlist</validator-id>
>>
>> <validator-class>netwave.utils.validators.Validator_List</validator-class>
>>    </validator>
>>    <converter>
>>        <converter-id>convertnumber</converter-id>
>>
>>
>> <converter-class>netwave.utils.converters.Converter_Integer</converter-class>
>>    </converter>
>>    <converter>
>>        <converter-id>convertfloat</converter-id>
>>
>>
>> <converter-class>netwave.utils.converters.Converter_Float</converter-class>
>>    </converter>
>>    <lifecycle>
>>        <phase-listener>netwave.utils.MessageListener</phase-listener>
>>    </lifecycle>
>> </faces-config>
>>
>> Fabio Ferrari
>>
>> 2010/3/23 Jakob Korherr <[email protected]>
>>
>> > Have you changed the filter config only? You must not change the config
>> for
>> > the FacesServlet.
>> >
>> > Take a look at http://myfaces.apache.org/tomahawk/extensionsFilter.html
>> >
>> > Maybe this will help you solve it!
>> >
>> > Regards,
>> > Jakob
>> >
>> >
>>
>
>

Reply via email to