1 Reply Latest reply on Jul 16, 2012 1:24 AM by yyq2009

    In RequestScope File upload is not working

    aniketmurtarkar

      Hello,

       

      I am using a rich:fileUpload but I have want to use only a requestscope of my managed bean file.

      I am using almost same code from the demo provided.

       

       

      but as I am using a request scope my "files" object is not geting stored any where so when i try to save it after uploading file I get files.size = 0.

       

      so I am unable to store data in my database.

      I have tried to use <h:inputHidden value="#{caseMaster.files}"

       

      but it gives me error for null values.

       

      INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.

      sourceId=j_idt9:j_idt200[severity=(ERROR 2), summary=(Conversion Error setting value '[]' for 'null Converter'.), detail=(Conversion Error setting value '[]' for 'null Converter'.)]

      INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.

      sourceId=j_idt9:j_idt200[severity=(ERROR 2), summary=(Conversion Error setting value '[]' for 'null Converter'.), detail=(Conversion Error setting value '[]' for 'null Converter'.)]

       

       

      so I am not getting how to solve this problem.

       

      can any one help me.

      Thanks in advance.

        • 1. Re: In RequestScope File upload is not working
          yyq2009

          Pls sure that you configed upload part correctly in your web.xml if you can't upload file.

           

          If you upload file successully and after that, the request bean will be recreated, so data in the bean will be lost, if you want it stored the data, you should use viewscope in jsf 2.0 or use <a4j:keepAlive beanName="yourbean"/> or myfaces <t:saveState value="#{bean.files}" /> in jsf 1.2.

           

           

          Good luck.