PrettyFaces 3.3.2 + Primefaces 3.x + Tomcat 6 file upload not working

Splash Forums PrettyFaces Users PrettyFaces 3.3.2 + Primefaces 3.x + Tomcat 6 file upload not working

This topic contains 4 replies, has 2 voices, and was last updated by  jasje 5 years, 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #18187

    jasje
    Participant

    Hi,

    I’m having a similar issue than the one discussed here (http://ocpsoft.org/support/topic/primefaces-30-fileupload-not-working-with-prettyfaces-330).

    The posted solution seems to work for Tomcat 7 but not for Tomcat 6.

    The upload listener just isn’t called. When I upgrade our production server to Tomcat 7, it works by adding <url-pattern>/*</url-pattern>

    Does anyone have a suggestion? It would be greatly appreciated.

    Thank you!

    Jonas

    #22209

    Which versions of PrettyFaces, PrimeFaces and your JSF implementation are you using? And could you please post your web.xml and pretty-config.xml?

    #22210

    jasje
    Participant

    Christian, thanks for your reply.

    This is what I’m running:

    JSF: Mojarra 2.1.4 (SNAPSHOT 20111107)

    Primefaces 3.1

    Prettyfaces 3.3.2

    web.xml (the interesting parts)

    <filter>

    <filter-name>Pretty Filter</filter-name>

    <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>

    </filter>

    <filter-mapping>

    <filter-name>Pretty Filter</filter-name>

    <url-pattern>/*</url-pattern>

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>ERROR</dispatcher>

    </filter-mapping>

    <filter>

    <filter-name>PrimeFaces FileUpload Filter</filter-name>

    <filter-class>

    org.primefaces.webapp.filter.FileUploadFilter

    </filter-class>

    <url-pattern>/*</url-pattern>

    </filter>

    <filter-mapping>

    <filter-name>PrimeFaces FileUpload Filter</filter-name>

    <servlet-name>Faces Servlet</servlet-name>

    </filter-mapping>

    pretty-config.xml

    <pretty-config xmlns="http://ocpsoft.com/prettyfaces/3.2.0"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    >

    <!-- Begin Example RewriteRules

    // These are custom rewrite-rules, and are probably not necessary for your application.

    -->

    <!-- Begin UrlMappings

    // These are examples of URL mappings, and should be customized for your application.

    <url-mapping id="home">

    <pattern value="/" />

    <view-id>/faces/index.jsf</view-id>

    </url-mapping>

    ....

    What I’ve also tried is adding

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>ERROR</dispatcher>

    on the filter part in my web.xml.

    For a Tomcat 7 server, I had to use this and it is working. On Tomcat 6 (6.0.35) it isn’t.

    #22211

    Perhaps there is some other component involved here (like a request listener) that is automatically registered in a Servlet 3.0 environment, but not on Tomcat 6.0. You should check the /META-INF/web-fragment.xml of the PrimeFaces archive for something like this.

    #22212

    jasje
    Participant

    SOLVED

    This configuration in web.xml solved the problem:

    <filter-mapping>

    <filter-name>PrimeFaces FileUpload Filter</filter-name>

    <servlet-name>Faces Servlet</servlet-name>

    <dispatcher>FORWARD</dispatcher>

    </filter-mapping>

    so no url-pattern and only the FORWARD dispatcher.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Comments are closed.