FileUpload - only works with session scope

UI Components for JSF
Post Reply
edudebom
Posts: 70
Joined: 14 Jan 2011, 18:01
Location: Brazil

05 Sep 2011, 16:43

Hello !!!

I' ve a problem when I use ViewScope: Error in streaming dynamic resource.
Only works with session scope.

My web.xml

Code: Select all

    <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>2048000</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>PrimeFaces FileUpload Filter</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
My xhtml

Code: Select all

                            <p:fileUpload fileUploadListener="#{prodServMB.envia}"
                                          mode="single"
                                          multiple="false"
                                          auto="true"
                                          update="imageUpload"
                                          allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>
                            
                            <p:graphicImage id="imageUpload" cache="false" value="#{prodServMB.imagem}" />
My MB

Code: Select all

    public void envia(FileUploadEvent event) {
        try {
                    imagem = new DefaultStreamedContent(event.getFile().getInputstream());
                    time = new Date().getTime();
        } catch (IOException ex) {
            Logger.getLogger(ProdServMB.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
Mojarra 2.1.6; GlassFish 3.1.2.2; PrimeFaces 4.0-SNAPSHOT
Brasil

ybendek
Posts: 102
Joined: 05 Aug 2011, 17:52

09 Nov 2011, 18:07

Hi man, the real problem is with graphicImage component ... I have the same issue....

I tried with the last prime-showcase, just modify the scope for DynamicImageController Managed Bean from request to view... and now the same error appear.

SEVERE: Error in streaming dynamic resource.

webmeiker
Posts: 106
Joined: 20 Dec 2011, 17:43

28 Feb 2012, 15:16

Have somebody solved that?
PrimeFaces 3.4.2, Mojarra 2.0.6, Apache Tomcat/7.0.22

User avatar
T.dot
Expert Member
Posts: 620
Joined: 01 Feb 2012, 15:39
Location: Vienna/Austria

28 Feb 2012, 17:00

View scope is not support. Read the documentation.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

28 Feb 2012, 17:01

See user's guide, graphicImage section.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests