Split: PrettyFaces + PrimeFaces file upload not working

Splash Forums PrettyFaces Users Split: PrettyFaces + PrimeFaces file upload not working

This topic contains 6 replies, has 3 voices, and was last updated by  Christian Kaltepoth 2 years, 8 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #25560

    ravindra
    Participant

    Thanks for your support,

    Am facing one more problem ,

    am using prime faces+pretty faces +spring in my project,

    before configuring pretty faces prime faces file upload working fine,
    when i configured pretty faces its not working ,

    i configured my web.xml as follows

    <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>
            <dispatcher>ASYNC</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>2097152</param-value>
            </init-param>
            <init-param>
                <param-name>uploadDirectory</param-name>
                <param-value>${primefaces.file.upload.directory}</param-value>
            </init-param>
        </filter>
        <filter-mapping>
            <filter-name>PrimeFaces FileUpload Filter</filter-name>
            <servlet-name>Faces Servlet</servlet-name> 
             <dispatcher>FORWARD</dispatcher>              
        </filter-mapping>
    
     <servlet>
            <servlet-name>Faces Servlet</servlet-name>
            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
     </servlet>

    I wrote rewrite rule in ConfigurationProvider class as follows

    return ConfigurationBuilder.begin()
                    .addRule(Join.path("/p/upload").to("/pages/uploadFile.xhtml").withInboundCorrection())

    primefaces fileupload component in jsf

     <p:fileUpload   value="#{fileUploadController.uploadForm.uploadFile}" mode="simple" auto="true" styleClass="cst_cursor_hand" id="freshFileId">
                                    <f:validator binding="#{profileFileUploadValidator}" />
      </p:fileUpload>

    I tried previous posts also but am unable to resolving this issue.

    Please help me on this its grateful to me.

    Thanks & Regards
    Ravindra

    #25564

    Please create new threads for new topics. I’ve split the topic for you again. Thanks.

    #25566

    You do not need to add PrettyFilter to web.xml as it no longer exists.

    #25568

    Try to configure the PrimeFaces filter so that it is applied for both REQUEST and FORWARD request types.

    
        <filter-mapping>
            <filter-name>PrimeFaces FileUpload Filter</filter-name>
            <servlet-name>Faces Servlet</servlet-name> 
            <dispatcher>REQUEST</dispatcher>              
            <dispatcher>FORWARD</dispatcher>              
        </filter-mapping>
    
    #25570

    ravindra
    Participant

    Hi,

    Thanks for your support,

    i will try it this scenario.

    Thanks & Regards

    Ravindra

    #25582

    ravindra
    Participant

    Hi Sir,

    Thanks for your support,

    I added tag allowCasualMultipartParsing=”true” in META-INF folder context.xml .

    Now its working fine.

    Thanks & Regards
    Ravindra

    #25584

    Great to hear you fixed your problem. I just remembered there is an entry in our FAQ regarding that:

    http://ocpsoft.org/rewrite/docs/faq

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

You must be logged in to reply to this topic.

Comments are closed.