PrettyFaces and PrimeFaces FileUploadFilter trouble

Splash Forums Rewrite Users PrettyFaces and PrimeFaces FileUploadFilter trouble

This topic contains 2 replies, has 2 voices, and was last updated by  LataGreemimax 4 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18890

    LataGreemimax
    Participant

    Hello

    My fileuploader doesn’t work since i’ve included prettyfaces.

    I think, it has something to do with the org.primefaces.webapp.filter.FileUploadFilter.

    The action method “#{catalogToolBacking.handleFileUpload}” is not called.

    The worst is I get no exceptions.

    web.xml

    <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>*.jsf</url-pattern>

    </servlet-mapping>

    <filter>

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

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

    <async-supported>true</async-supported>

    </filter>

    <filter-mapping>

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

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

    <dispatcher>FORWARD</dispatcher>

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>ERROR</dispatcher>

    <dispatcher>ASYNC</dispatcher>

    </filter-mapping>

    <filter>

    <filter-name>HibernateFilter</filter-name>

    <filter-class>ch.futuretek.merkur.filter.HibernateSessionRequestFilter</filter-class>

    </filter>

    <filter-mapping>

    <filter-name>HibernateFilter</filter-name>

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

    <dispatcher>REQUEST</dispatcher>

    <dispatcher>FORWARD</dispatcher>

    </filter-mapping>

    <filter>

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

    <filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>

    <init-param>

    <param-name>thresholdSize</param-name>

    <param-value>50240</param-value>

    </init-param>

    </filter>

    <filter-mapping>

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

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

    </filter-mapping>

    the.xhtml

    <h:form id="messagesForm">

    <p:growl id="messages" showDetail="true" life="5000" />

    </h:form>

    <h:form id="uploadForm">

    <p:panel id="uploadPanelId" header="Upload Content" collapsed="true"

    style="margin: 10px auto; width: 1060px;" toggleable="true"

    closable="true" toggleSpeed="500" closeSpeed="2000"

    widgetVar="uploadPanel">

    <p:fileUpload

    fileUploadListener="#{catalogToolBacking.handleFileUpload}"

    mode="advanced" update=":messagesForm:messages, :myCropperForm:catalogMenuTab"

    auto="false" multiple="true" process="@all"

    label="Choose a file or drag and drop it here" sizeLimit="50485760"

    allowTypes="/(.|/)(pdf|jpe?g|png)$/"

    description="Images and PDF's"

    invalidSizeMessage="The maximum file size allowed is 50 Megabytes !"

    invalidFileMessage="You are allowed to upload only JPEG, PNG and PDF !"

    onstart="onUploadStart();" oncomplete="onUploadComplete();" />

    </p:panel>

    </h:form>

    I’m happy for any kind of help.

    #23168

    I believe your primefaces filter also needs to support the FORWARD and ASYNC dispatcher types. Try adding them all and see what happens.

    #23169

    LataGreemimax
    Participant

    Great,it works!

    Thanks very much!

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

You must be logged in to reply to this topic.

Comments are closed.