You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Alecsandru Chirosca <al...@comtec.ro> on 2004/11/17 16:41:57 UTC

FileUploadProblem

Hi list,


I have a problem width the fileUpload component, when I use
multipart/form-data my form does noting (the button that connects to the
upload() function from my bean does nothing. When I remove the
multipart/form-data encoduing declaration from the h:form element the
upload() function gets called but I hane null value in the upploadedFile
property. 
Anyone had this problem? 
the page is quite large and includes a lot of HTML code.

Any ideea will be apreciated.


Best regards,
Alecs

Re: FileUploadProblem

Posted by Alecsandru Chirosca <al...@comtec.ro>.
I solved the problems using the Oracle native Callable Statement. 
The random behaviour of the application was due unhandled exceptions
outside my application. 

Hope this helps somebody.


BR 
Alecs

On Thu, 2004-11-18 at 11:48, Alecsandru Chirosca wrote:

> This will help if you are using hibernate : 
> 
>                     InputStream fis =
> this.getUploadedFile().getInputStream();
>                     Blob blob = Hibernate.createBlob(fis);
> 
> BR,
> Alecs 
> 
> On Thu, 2004-11-18 at 11:41, Francesco Consumi wrote: 
> 
> > Hi,
> > 
> > while you're talking about FileUpload, i've another question related:
> > someone has a code fragment able to load a file directly into a blob ?
> > 
> > thanks,
> > 
> > --
> > Francesco Consumi
> > 

Re: FileUploadProblem

Posted by Alecsandru Chirosca <al...@comtec.ro>.
This will help if you are using hibernate : 

                    InputStream fis =
this.getUploadedFile().getInputStream();
                    Blob blob = Hibernate.createBlob(fis);

BR,
Alecs 

On Thu, 2004-11-18 at 11:41, Francesco Consumi wrote:

> Hi,
> 
> while you're talking about FileUpload, i've another question related:
> someone has a code fragment able to load a file directly into a blob ?
> 
> thanks,
> 
> --
> Francesco Consumi
> 
> 

Re: FileUploadProblem

Posted by Nicolas Arni-Bloch <Ni...@cui.unige.ch>.
The problem with blob depend on your DBMS. The problem with oracle is 
that they JDBC driver is not compliant with the API (for the blob) so 
you have to make a cast to get the OracleResultSet and OracleBLOB. It's 
a problem when you want to make a generic application.
In order to avoid this problem the best way is to use a Relational to 
Object Mapping tools like Hibernate or OJB (Hibernate is better for 
blob I think).
Le 18 nov. 04, à 10:41, Francesco Consumi a écrit :

> Hi,
>
> while you're talking about FileUpload, i've another question related:
> someone has a code fragment able to load a file directly into a blob ?
>
> thanks,
>
> --
> Francesco Consumi
>
>
>
--
Nicolas Arni-Bloch               						
Groupe MATIS-Bd, Centre Universitaire d'Informatique
24 rue General-Dufour
CH-1205 Genève
eMail : nicolas.arni-bloch@cui.unige.ch
phone : +41 22 379 76 80
fax : +41 22 379 77 80


Re: FileUploadProblem

Posted by Francesco Consumi <co...@istitutodeglinnocenti.it>.
Hi,

while you're talking about FileUpload, i've another question related:
someone has a code fragment able to load a file directly into a blob ?

thanks,

--
Francesco Consumi



RE: FileUploadProblem

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
Alecsandru,

I saw you have *.jsp instead of *.jsf

perhaps that solves your problems?


<filter-mapping>
        <filter-name>multipartFilter</filter-name>
        <url-pattern>*.jsp</url-pattern>
    </filter-mapping>


-Matthias

> -----Original Message-----
> From: Martin Marinschek [mailto:martin.marinschek@gmail.com] 
> Sent: Thursday, November 18, 2004 9:43 AM
> To: MyFaces Discussion
> Subject: Re: FileUploadProblem
> 
> 
> strange... I don't have any problems with file-upload, using 
> it every day...
> 
> just to tell you: the 4kB restriction in oracle is something 
> you can work around, if need be
> 
> regards,
> 
> Martin
> 
> 
> On Thu, 18 Nov 2004 09:41:21 +0200, Alecsandru Chirosca 
> <al...@comtec.ro> wrote:
> >  Hi,
> >  
> >  Here are the informations you requested.
> >  
> >  
> >  The 4k limitation to fileupload is due Oracle BLOB handling 
> > limitation.
> >  
> >  Here are the relevant parts of web.xml :
> >    <filter>
> >      <filter-name>multipartFilter</filter-name>
> >     
> > 
> <filter-class>net.sourceforge.myfaces.custom.fileupload.Multip
> artFilter</filter-class>
> >      <init-param>
> >          <param-name>maxFileSize</param-name>
> >          <param-value>4k</param-value>
> >          <description>limita de upload la fisiere</description>
> >      </init-param>
> >    </filter>
> >  ......
> >  <filter-mapping>
> >      <filter-name>multipartFilter</filter-name>
> >      <url-pattern>*.jsp</url-pattern>
> >  </filter-mapping>
> >  
> >  
> >  and from our jsp page :
> >  .....
> >              <jh:form id="form1" name="form1" 
> enctype="multipart/form-data">
> >                  <jh:panelGrid id="pg1" 
> >                      cellspacing="0px" columns="1" 
> styleClass="bodyClass"
> >                      columnClasses="bodyTDLeft,bodyTDright">
> >                      <jc:facet name="header">
> >                          <jh:graphicImage
> > url="/afiseazaSigla?imagine=#{editorSigla.societatea.id}"
> >                          alt="imagine indisponibila"/>
> >                              <!-- this is an image display 
> servlet --> 
> >                      </jc:facet>
> >                      <je:inputFileUpload id="aUpload" 
> >                          value="#{editorSigla.siglaNoua}"
> >                          storage="file"
> >                          accept="image/*"/>
> >                      <jc:facet name="footer">
> >                          <jh:commandButton id="trimiteimaginea"
> > value="trimite" action="#{editorSigla.modifica}"/>
> >                      </jc:facet>
> >                  </jh:panelGrid>                                
> >              </jh:form>
> >  .....
> >  
> >  
> >  The problem is that the procedure editorSigla.modifica 
> does not get 
> > called at all when using multipart/form-data encoding.
> >  
> >  
> >  Best regards,
> >  Alecs
> >  
> >  
> >  
> >  On Wed, 2004-11-17 at 17:58, Nicolas Arni-Bloch wrote:
> >  Are sure that the multipartFilter is enable ? Normally you 
> must havesome
> > think like this in your web.xml (and uncommented) 
> > 
> > 
> >  <filter>
> >          <filter-name>multipartFilter</filter-name>
> >        
> > 
> <filter-class>net.sourceforge.myfaces.custom.fileupload.Multip
> artFilter</filter-class>
> >          <init-param>
> >              <param-name>maxFileSize</param-name>
> >              <param-value>10m</param-value>
> >              <description>Set the size limit for uploaded files.
> >                  Format: 10 - 10 bytes
> >                          10k - 10 KB
> >                          10m - 10 MB
> >              </description>
> >          </init-param>
> >      </filter>
> >  
> >  and if you doesn't put  multipart/form-data in you form it's 
> > normalthat you have a null value because the multipartFilter is not 
> > calledto.
> >  
> >  Le 17 nov. 04, à 16:41, Alecsandru Chirosca a écrit :
> >  
> >  
> >  Hi list,
> >  
> >  
> >  I have a problem width the fileUpload component, when I 
> > usemultipart/form-data my form does noting (the button that 
> connects 
> > tothe
> > upload() function from my bean does nothing. When I remove
> > themultipart/form-data encoduing declaration from the h:form element
> > theupload() function gets called but I hane null value in 
> theupploadedFile
> > property. 
> > 
> > 
> >  Anyone had this problem?
> >  the page is quite large and includes a lot of HTML code.
> >  
> >  Any ideea will be apreciated.
> >  
> >  
> >  Best regards,
> >  Alecs
> > 
> >  --
> >  Nicolas Arni-Bloch               
> >  Groupe MATIS-Bd, Centre Universitaire d'Informatique
> >  24 rue General-Dufour
> >  CH-1205 Genève
> >  eMail : nicolas.arni-bloch@cui.unige.ch
> >  phone : +41 22 379 76 80
> >  fax : +41 22 379 77 80
> 


Re: FileUploadProblem

Posted by Martin Marinschek <ma...@gmail.com>.
try looking for the real class of the blob you get returned from
Hibernate and see if they have a method like getDelegateBlob or sthg
like that.

regards,

Martin


On Thu, 18 Nov 2004 11:52:03 +0200, Alecsandru Chirosca
<al...@comtec.ro> wrote:
>  I/m using jsp not jsf files extension.
>  
>  The strange part is that the same code works in a new jsp page that does
> not contain the HTML decorations, but with full debug of myfaces I cannot
> identify the error. The java code is OK and it works with a siplier page. 
>  
>  The error is in page display when rendering the body of the page. the
> strange part is that myfaces does not log anything at all..... an exception
> will come very handy in such cases. I remeber that I had previous problems
> with commandButton and not width commandLink. 
>  
>  now i'm hunting the error..... I remove any element and isolate the begus
> one.
>  
>  About the 4k Oracle limitation I have no workaround at this time becouse
> I'm using hibernate for database abstraction layer. I'm recomanding this
> tool to anyone. It is not working with Oracle BLOB becouse you always get
> ClassCastException whec casting
>      (OracleBLOG)myBlob
>  this is where I stopped with the Oracle testing. 
>  
>  
>  Best regards,
> 
> 
>  Alecs
>  
>  
>  On Thu, 2004-11-18 at 10:52, Nicolas Arni-Bloch wrote: 
>  I'm using oracle to with blob and I know this *&%& 4kb limitation, can you
> send the java code and maybe some error ? Le 18 nov. 04, à 09:42, Martin
> Marinschek a écrit : > strange... I don't have any problems with
> file-upload, using it every > day... > > just to tell you: the 4kB
> restriction in oracle is something you can > work around, if need be > >
> regards, > > Martin > > > On Thu, 18 Nov 2004 09:41:21 +0200, Alecsandru
> Chirosca > <al...@comtec.ro> wrote: >> Hi, >> >> Here are the
> informations you requested. >> >> >> The 4k limitation to fileupload is due
> Oracle BLOB handling >> limitation. >> >> Here are the relevant parts of
> web.xml : >> <filter> >> <filter-name>multipartFilter</filter-name> >> >>
> <filter- >>
> class>net.sourceforge.myfaces.custom.fileupload.MultipartFilter</ >>
> filter-class> >> <init-param> >> <param-name>maxFileSize</param-name> >>
> <param-value>4k</param-value> >> <description>limita de upload la
> fisiere</description> >> </init-param> >> </filter> >> ...... >>
> <filter-mapping> >> <filter-name>multipartFilter</filter-name> >>
> <url-pattern>*.jsp</url-pattern> >> </filter-mapping> >> >> >> and from our
> jsp page : >> ..... >> <jh:form id="form1" name="form1" >>
> enctype="multipart/form-data"> >> <jh:panelGrid id="pg1" >>
> cellspacing="0px" columns="1" >> styleClass="bodyClass" >>
> columnClasses="bodyTDLeft,bodyTDright"> >> <jc:facet name="header"> >>
> <jh:graphicImage >>
> url="/afiseazaSigla?imagine=#{editorSigla.societatea.id}" >> alt="imagine
> indisponibila"/> >> <!-- this is an image display servlet --> >> </jc:facet>
> >> <je:inputFileUpload id="aUpload" >> value="#{editorSigla.siglaNoua}" >>
> storage="file" >> accept="image/*"/> >> <jc:facet name="footer"> >>
> <jh:commandButton id="trimiteimaginea" >> value="trimite"
> action="#{editorSigla.modifica}"/> >> </jc:facet> >> </jh:panelGrid> >>
> </jh:form> >> ..... >> >> >> The problem is that the procedure
> editorSigla.modifica does not get >> called >> at all when using
> multipart/form-data encoding. >> >> >> Best regards, >> Alecs >> >> >> >> On
> Wed, 2004-11-17 at 17:58, Nicolas Arni-Bloch wrote: >> Are sure that the
> multipartFilter is enable ? Normally you must >> havesome >> think like this
> in your web.xml (and uncommented) >> >> >> <filter> >>
> <filter-name>multipartFilter</filter-name> >> >> <filter- >>
> class>net.sourceforge.myfaces.custom.fileupload.MultipartFilter</ >>
> filter-class> >> <init-param> >> <param-name>maxFileSize</param-name> >>
> <param-value>10m</param-value> >> <description>Set the size limit for
> uploaded files. >> Format: 10 - 10 bytes >> 10k - 10 KB >> 10m - 10 MB >>
> </description> >> </init-param> >> </filter> >> >> and if you doesn't put
> multipart/form-data in you form it's >> normalthat you >> have a null value
> because the multipartFilter is not calledto. >> >> Le 17 nov. 04, à 16:41,
> Alecsandru Chirosca a écrit : >> >> >> Hi list, >> >> >> I have a problem
> width the fileUpload component, when I >> usemultipart/form-data my form
> does noting (the button that connects >> tothe >> upload() function from my
> bean does nothing. When I remove >> themultipart/form-data encoduing
> declaration from the h:form element >> theupload() function gets called but
> I hane null value in >> theupploadedFile >> property. >> >> >> Anyone had
> this problem? >> the page is quite large and includes a lot of HTML code. >>
> >> Any ideea will be apreciated. >> >> >> Best regards, >> Alecs >> >> -- >>
> Nicolas Arni-Bloch >> Groupe MATIS-Bd, Centre Universitaire d'Informatique
> >> 24 rue General-Dufour >> CH-1205 Genève >> eMail :
> nicolas.arni-bloch@cui.unige.ch >> phone : +41 22 379 76 80 >> fax : +41 22
> 379 77 80 > > -- Nicolas Arni-Bloch Groupe MATIS-Bd, Centre Universitaire
> d'Informatique 24 rue General-Dufour CH-1205 Genève eMail :
> nicolas.arni-bloch@cui.unige.ch phone : +41 22 379 76 80 fax : +41 22 379 77
> 80

Re: FileUploadProblem

Posted by Nicolas Arni-Bloch <Ni...@cui.unige.ch>.
But have you try what Matthias said :
replace
<filter-mapping>
         <filter-name>multipartFilter</filter-name>
         <url-pattern>*.jsp</url-pattern>
     </filter-mapping>

by
<filter-mapping>
         <filter-name>multipartFilter</filter-name>
         <url-pattern>*.jsf</url-pattern>
     </filter-mapping>

I don't think that you can use jsp has filter mapping. Your files are 
jsp but in the url you call .jsf. So if you want that the 
multpartFilter work you have to specify the right mapping filter. The 
one how are in the url.

Le 18 nov. 04, à 10:52, Alecsandru Chirosca a écrit :

>  I/m using jsp not jsf files extension.
>
>  The strange part is that the same code works in a new jsp page that 
> does not contain the HTML decorations, but with full debug of myfaces 
> I cannot identify the error. The java code is OK and it works with a 
> siplier page.
>
>  The error is in page display when rendering the body of the page. the 
> strange part is that myfaces does not log anything at all..... an 
> exception will come very handy in such cases. I remeber that I had 
> previous problems with commandButton and not width commandLink.
>
>  now i'm hunting the error..... I remove any element and isolate the 
> begus one.
>
>  About the 4k Oracle limitation I have no workaround at this time 
> becouse I'm using hibernate for database abstraction layer. I'm 
> recomanding this tool to anyone. It is not working with Oracle BLOB 
> becouse you always get ClassCastException whec casting
>      (OracleBLOG)myBlob
>  this is where I stopped with the Oracle testing.
>
>
>  Best regards,
>  Alecs
>
>
>  On Thu, 2004-11-18 at 10:52, Nicolas Arni-Bloch wrote:
> I'm using oracle to with blob and I know this *&%& 4kb limitation,
> can you send the java code and maybe some error ?
> Le 18 nov. 04, à 09:42, Martin Marinschek a écrit :
>
> > strange... I don't have any problems with file-upload, using it every
> > day...
> >
> > just to tell you: the 4kB restriction in oracle is something you can
> > work around, if need be
> >
> > regards,
> >
> > Martin
> >
> >
> > On Thu, 18 Nov 2004 09:41:21 +0200, Alecsandru Chirosca
> > <al...@comtec.ro> wrote:
> >>  Hi,
> >>
> >>  Here are the informations you requested.
> >>
> >>
> >>  The 4k limitation to fileupload is due Oracle BLOB handling
> >> limitation.
> >>
> >>  Here are the relevant parts of web.xml :
> >>    <filter>
> >>      <filter-name>multipartFilter</filter-name>
> >>
> >> <filter-
> >> class>net.sourceforge.myfaces.custom.fileupload.MultipartFilter</
> >> filter-class>
> >>      <init-param>
> >>          <param-name>maxFileSize</param-name>
> >>          <param-value>4k</param-value>
> >>          <description>limita de upload la fisiere</description>
> >>      </init-param>
> >>    </filter>
> >>  ......
> >>  <filter-mapping>
> >>      <filter-name>multipartFilter</filter-name>
> >>      <url-pattern>*.jsp</url-pattern>
> >>  </filter-mapping>
> >>
> >>
> >>  and from our jsp page :
> >>  .....
> >>              <jh:form id="form1" name="form1"
> >> enctype="multipart/form-data">
> >>                  <jh:panelGrid id="pg1"
> >>                      cellspacing="0px" columns="1"
> >> styleClass="bodyClass"
> >>                      columnClasses="bodyTDLeft,bodyTDright">
> >>                      <jc:facet name="header">
> >>                          <jh:graphicImage
> >> url="/afiseazaSigla?imagine=#{editorSigla.societatea.id}"
> >>                          alt="imagine indisponibila"/>
> >>                              <!-- this is an image display servlet 
> -->
> >>                      </jc:facet>
> >>                      <je:inputFileUpload id="aUpload"
> >>                          value="#{editorSigla.siglaNoua}"
> >>                          storage="file"
> >>                          accept="image/*"/>
> >>                      <jc:facet name="footer">
> >>                          <jh:commandButton id="trimiteimaginea"
> >> value="trimite" action="#{editorSigla.modifica}"/>
> >>                      </jc:facet>
> >>                  </jh:panelGrid>
> >>              </jh:form>
> >>  .....
> >>
> >>
> >>  The problem is that the procedure editorSigla.modifica does not get
> >> called
> >> at all when using multipart/form-data encoding.
> >>
> >>
> >>  Best regards,
> >>  Alecs
> >>
> >>
> >>
> >>  On Wed, 2004-11-17 at 17:58, Nicolas Arni-Bloch wrote:
> >>  Are sure that the multipartFilter is enable ? Normally you must
> >> havesome
> >> think like this in your web.xml (and uncommented)
> >>
> >>
> >>  <filter>
> >>          <filter-name>multipartFilter</filter-name>
> >>
> >> <filter-
> >> class>net.sourceforge.myfaces.custom.fileupload.MultipartFilter</
> >> filter-class>
> >>          <init-param>
> >>              <param-name>maxFileSize</param-name>
> >>              <param-value>10m</param-value>
> >>              <description>Set the size limit for uploaded files.
> >>                  Format: 10 - 10 bytes
> >>                          10k - 10 KB
> >>                          10m - 10 MB
> >>              </description>
> >>          </init-param>
> >>      </filter>
> >>
> >>  and if you doesn't put  multipart/form-data in you form it's
> >> normalthat you
> >> have a null value because the multipartFilter is not calledto.
> >>
> >>  Le 17 nov. 04, à 16:41, Alecsandru Chirosca a écrit :
> >>
> >>
> >>  Hi list,
> >>
> >>
> >>  I have a problem width the fileUpload component, when I
> >> usemultipart/form-data my form does noting (the button that connects
> >> tothe
> >> upload() function from my bean does nothing. When I remove
> >> themultipart/form-data encoduing declaration from the h:form element
> >> theupload() function gets called but I hane null value in
> >> theupploadedFile
> >> property.
> >>
> >>
> >>  Anyone had this problem?
> >>  the page is quite large and includes a lot of HTML code.
> >>
> >>  Any ideea will be apreciated.
> >>
> >>
> >>  Best regards,
> >>  Alecs
> >>
> >>  --
> >>  Nicolas Arni-Bloch
> >>  Groupe MATIS-Bd, Centre Universitaire d'Informatique
> >>  24 rue General-Dufour
> >>  CH-1205 Genève
> >>  eMail : nicolas.arni-bloch@cui.unige.ch
> >>  phone : +41 22 379 76 80
> >>  fax : +41 22 379 77 80
> >
> >
> --
> Nicolas Arni-Bloch
> Groupe MATIS-Bd, Centre Universitaire d'Informatique
> 24 rue General-Dufour
> CH-1205 Genève
> eMail : nicolas.arni-bloch@cui.unige.ch
> phone : +41 22 379 76 80
> fax : +41 22 379 77 80
>
>
--
Nicolas Arni-Bloch               						
Groupe MATIS-Bd, Centre Universitaire d'Informatique
24 rue General-Dufour
CH-1205 Genève
eMail : nicolas.arni-bloch@cui.unige.ch
phone : +41 22 379 76 80
fax : +41 22 379 77 80

Re: FileUploadProblem

Posted by Alecsandru Chirosca <al...@comtec.ro>.
I/m using jsp not jsf files extension.

The strange part is that the same code works in a new jsp page that does
not contain the HTML decorations, but with full debug of myfaces I
cannot identify the error. The java code is OK and it works with a
siplier page. 

The error is in page display when rendering the body of the page. the
strange part is that myfaces does not log anything at all..... an
exception will come very handy in such cases. I remeber that I had
previous problems with commandButton and not width commandLink. 

now i'm hunting the error..... I remove any element and isolate the
begus one.

About the 4k Oracle limitation I have no workaround at this time becouse
I'm using hibernate for database abstraction layer. I'm recomanding this
tool to anyone. It is not working with Oracle BLOB becouse you always
get ClassCastException whec casting
    (OracleBLOG)myBlob
this is where I stopped with the Oracle testing. 


Best regards,
Alecs


On Thu, 2004-11-18 at 10:52, Nicolas Arni-Bloch wrote:

> I'm using oracle to with blob and I know this *&%& 4kb limitation,
> can you send the java code and maybe some error ?
> Le 18 nov. 04, � 09:42, Martin Marinschek a �crit :
> 
> > strange... I don't have any problems with file-upload, using it every  
> > day...
> >
> > just to tell you: the 4kB restriction in oracle is something you can
> > work around, if need be
> >
> > regards,
> >
> > Martin
> >
> >
> > On Thu, 18 Nov 2004 09:41:21 +0200, Alecsandru Chirosca
> > <al...@comtec.ro> wrote:
> >>  Hi,
> >>
> >>  Here are the informations you requested.
> >>
> >>
> >>  The 4k limitation to fileupload is due Oracle BLOB handling  
> >> limitation.
> >>
> >>  Here are the relevant parts of web.xml :
> >>    <filter>
> >>      <filter-name>multipartFilter</filter-name>
> >>
> >> <filter- 
> >> class>net.sourceforge.myfaces.custom.fileupload.MultipartFilter</ 
> >> filter-class>
> >>      <init-param>
> >>          <param-name>maxFileSize</param-name>
> >>          <param-value>4k</param-value>
> >>          <description>limita de upload la fisiere</description>
> >>      </init-param>
> >>    </filter>
> >>  ......
> >>  <filter-mapping>
> >>      <filter-name>multipartFilter</filter-name>
> >>      <url-pattern>*.jsp</url-pattern>
> >>  </filter-mapping>
> >>
> >>
> >>  and from our jsp page :
> >>  .....
> >>              <jh:form id="form1" name="form1"  
> >> enctype="multipart/form-data">
> >>                  <jh:panelGrid id="pg1"
> >>                      cellspacing="0px" columns="1"  
> >> styleClass="bodyClass"
> >>                      columnClasses="bodyTDLeft,bodyTDright">
> >>                      <jc:facet name="header">
> >>                          <jh:graphicImage
> >> url="/afiseazaSigla?imagine=#{editorSigla.societatea.id}"
> >>                          alt="imagine indisponibila"/>
> >>                              <!-- this is an image display servlet -->
> >>                      </jc:facet>
> >>                      <je:inputFileUpload id="aUpload"
> >>                          value="#{editorSigla.siglaNoua}"
> >>                          storage="file"
> >>                          accept="image/*"/>
> >>                      <jc:facet name="footer">
> >>                          <jh:commandButton id="trimiteimaginea"
> >> value="trimite" action="#{editorSigla.modifica}"/>
> >>                      </jc:facet>
> >>                  </jh:panelGrid>
> >>              </jh:form>
> >>  .....
> >>
> >>
> >>  The problem is that the procedure editorSigla.modifica does not get  
> >> called
> >> at all when using multipart/form-data encoding.
> >>
> >>
> >>  Best regards,
> >>  Alecs
> >>
> >>
> >>
> >>  On Wed, 2004-11-17 at 17:58, Nicolas Arni-Bloch wrote:
> >>  Are sure that the multipartFilter is enable ? Normally you must  
> >> havesome
> >> think like this in your web.xml (and uncommented)
> >>
> >>
> >>  <filter>
> >>          <filter-name>multipartFilter</filter-name>
> >>
> >> <filter- 
> >> class>net.sourceforge.myfaces.custom.fileupload.MultipartFilter</ 
> >> filter-class>
> >>          <init-param>
> >>              <param-name>maxFileSize</param-name>
> >>              <param-value>10m</param-value>
> >>              <description>Set the size limit for uploaded files.
> >>                  Format: 10 - 10 bytes
> >>                          10k - 10 KB
> >>                          10m - 10 MB
> >>              </description>
> >>          </init-param>
> >>      </filter>
> >>
> >>  and if you doesn't put  multipart/form-data in you form it's  
> >> normalthat you
> >> have a null value because the multipartFilter is not calledto.
> >>
> >>  Le 17 nov. 04, � 16:41, Alecsandru Chirosca a �crit :
> >>
> >>
> >>  Hi list,
> >>
> >>
> >>  I have a problem width the fileUpload component, when I
> >> usemultipart/form-data my form does noting (the button that connects  
> >> tothe
> >> upload() function from my bean does nothing. When I remove
> >> themultipart/form-data encoduing declaration from the h:form element
> >> theupload() function gets called but I hane null value in  
> >> theupploadedFile
> >> property.
> >>
> >>
> >>  Anyone had this problem?
> >>  the page is quite large and includes a lot of HTML code.
> >>
> >>  Any ideea will be apreciated.
> >>
> >>
> >>  Best regards,
> >>  Alecs
> >>
> >>  --
> >>  Nicolas Arni-Bloch
> >>  Groupe MATIS-Bd, Centre Universitaire d'Informatique
> >>  24 rue General-Dufour
> >>  CH-1205 Gen�ve
> >>  eMail : nicolas.arni-bloch@cui.unige.ch
> >>  phone : +41 22 379 76 80
> >>  fax : +41 22 379 77 80
> >
> >
> --
> Nicolas Arni-Bloch               						
> Groupe MATIS-Bd, Centre Universitaire d'Informatique
> 24 rue General-Dufour
> CH-1205 Gen�ve
> eMail : nicolas.arni-bloch@cui.unige.ch
> phone : +41 22 379 76 80
> fax : +41 22 379 77 80
> 

Re: FileUploadProblem

Posted by Martin Marinschek <ma...@gmail.com>.
Essentially, you have to insert an empty_lob() first and then get the
binary outputstream for this lob; finally you stream the data to this
output stream..

regards,

Martin

    private static Log log = LogFactory.getLog(BlobWrapper.class);

    /**
     * Creates a new instance of BlobWrapper
     */
    public BlobWrapper(Connection connection, String tableName, String
idColumn, String lobColumn)
    {
        super(connection, tableName, idColumn, lobColumn);
    }

    /**
     * Creates a new instance of BlobWrapper; providing a sequence.
     */
    public BlobWrapper(Connection connection, String tableName, String
seqName, String idColumn, String lobColumn)
    {
        super(connection, tableName, seqName, idColumn, lobColumn);
    }

    protected String getEmptyLobString()
    {
        return "empty_blob()";
    }

    protected void handleLobResultSetForWriting(ResultSet rs,
                                      Object inputStreamOrReader,
String query) throws SQLException
    {
        if(!(inputStreamOrReader instanceof InputStream))
            throw new SQLException("InputStream (and no Reader) must
be provided.");

        BLOB blob = null;

        if(rs.next())
        {
            blob = (oracle.sql.BLOB) rs.getBlob(_lobColumn);
        }
        else
            throw new SQLException("BLOB not found");

        if(rs.next())
            throw new SQLException("BLOB not uniquely identified.");

        int size = blob.getBufferSize();

        OutputStream outstream = blob.getBinaryOutputStream ();

        writeStream((InputStream)
inputStreamOrReader,outstream,size,query.toString());
    }

    public int getBufferSize(Blob blob)
            throws SQLException
    {
        int bufferSize;
        if(blob instanceof BLOB)
        {
            bufferSize= ((BLOB) blob).getBufferSize();
        }
        else
        {
            bufferSize=(int) Math.min(blob.length(),100000);
        }
        return bufferSize;
    }

    public void selectFile(String id, String fileName)
    {
        File binaryFile = new File(fileName);

        Blob blob = select(id);

        try
        {
            InputStream instream = blob.getBinaryStream();
            OutputStream outstream = new FileOutputStream(binaryFile);

            int bufferSize;

            bufferSize = getBufferSize(blob);

            writeStream(instream,outstream,bufferSize,fileName);
        }
        catch(SQLException ex)
        {
            IllegalStateException ex2 =
                new IllegalStateException("Reading did not work");
            ex2.initCause(ex);
            throw ex2;
        }
        catch(IOException ex)
        {
            IllegalStateException ex2 =
                new IllegalStateException("Writing was not possible");
            ex2.initCause(ex);
            throw ex2;
        }
    }

    public Blob select(String id)
    {

        addColumn(_idColumn);
        addColumn(_lobColumn);

        Statement stmt = null;
        ResultSet rs = null;
        StringBuffer selectBuf = null;

        try
        {
            stmt = _connection.createStatement();

            selectBuf = new StringBuffer();
            selectBuf.append("SELECT ");

            addColumnNames(selectBuf);

            selectBuf.append(" FROM ");
            selectBuf.append(_tableName);
            selectBuf.append(" WHERE ");
            selectBuf.append(_idColumn);
            selectBuf.append("=");
            selectBuf.append(id);

            rs = stmt.executeQuery(selectBuf.toString());

            Blob blob = null;

            if(rs.next())
            {
                blob = rs.getBlob(_lobColumn);

                getColumnValues(rs);
            }
            else
                throw new SQLException("BLOB not found.
Select-statement : "+selectBuf==null?null:selectBuf.toString());

            if(rs.next())
                throw new SQLException("BLOB not uniquely identified.
Select-statement : "+selectBuf==null?null:selectBuf.toString());

            return blob;
        }
        catch(SQLException ex)
        {
            IllegalStateException ex2 =
                new IllegalStateException("Writing did not work,
Select-statement : "+selectBuf==null?null:selectBuf.toString());
            ex2.initCause(ex);
            throw ex2;
        }
        finally
        {
            try
            {
                if(stmt!=null)
                    stmt.close();
                if(rs!=null)
                    rs.close();
            }
            catch(SQLException ex)
            {
                log.error("Exception while closing rs/stmt",ex);
            }
        }
    }


On Thu, 18 Nov 2004 09:52:34 +0100, Nicolas Arni-Bloch
<ni...@cui.unige.ch> wrote:
> I'm using oracle to with blob and I know this *&%& 4kb limitation,
> can you send the java code and maybe some error ?
> Le 18 nov. 04, à 09:42, Martin Marinschek a écrit :
> 
> 
> 
> > strange... I don't have any problems with file-upload, using it every
> > day...
> >
> > just to tell you: the 4kB restriction in oracle is something you can
> > work around, if need be
> >
> > regards,
> >
> > Martin
> >
> >
> > On Thu, 18 Nov 2004 09:41:21 +0200, Alecsandru Chirosca
> > <al...@comtec.ro> wrote:
> >>  Hi,
> >>
> >>  Here are the informations you requested.
> >>
> >>
> >>  The 4k limitation to fileupload is due Oracle BLOB handling
> >> limitation.
> >>
> >>  Here are the relevant parts of web.xml :
> >>    <filter>
> >>      <filter-name>multipartFilter</filter-name>
> >>
> >> <filter-
> >> class>net.sourceforge.myfaces.custom.fileupload.MultipartFilter</
> >> filter-class>
> >>      <init-param>
> >>          <param-name>maxFileSize</param-name>
> >>          <param-value>4k</param-value>
> >>          <description>limita de upload la fisiere</description>
> >>      </init-param>
> >>    </filter>
> >>  ......
> >>  <filter-mapping>
> >>      <filter-name>multipartFilter</filter-name>
> >>      <url-pattern>*.jsp</url-pattern>
> >>  </filter-mapping>
> >>
> >>
> >>  and from our jsp page :
> >>  .....
> >>              <jh:form id="form1" name="form1"
> >> enctype="multipart/form-data">
> >>                  <jh:panelGrid id="pg1"
> >>                      cellspacing="0px" columns="1"
> >> styleClass="bodyClass"
> >>                      columnClasses="bodyTDLeft,bodyTDright">
> >>                      <jc:facet name="header">
> >>                          <jh:graphicImage
> >> url="/afiseazaSigla?imagine=#{editorSigla.societatea.id}"
> >>                          alt="imagine indisponibila"/>
> >>                              <!-- this is an image display servlet -->
> >>                      </jc:facet>
> >>                      <je:inputFileUpload id="aUpload"
> >>                          value="#{editorSigla.siglaNoua}"
> >>                          storage="file"
> >>                          accept="image/*"/>
> >>                      <jc:facet name="footer">
> >>                          <jh:commandButton id="trimiteimaginea"
> >> value="trimite" action="#{editorSigla.modifica}"/>
> >>                      </jc:facet>
> >>                  </jh:panelGrid>
> >>              </jh:form>
> >>  .....
> >>
> >>
> >>  The problem is that the procedure editorSigla.modifica does not get
> >> called
> >> at all when using multipart/form-data encoding.
> >>
> >>
> >>  Best regards,
> >>  Alecs
> >>
> >>
> >>
> >>  On Wed, 2004-11-17 at 17:58, Nicolas Arni-Bloch wrote:
> >>  Are sure that the multipartFilter is enable ? Normally you must
> >> havesome
> >> think like this in your web.xml (and uncommented)
> >>
> >>
> >>  <filter>
> >>          <filter-name>multipartFilter</filter-name>
> >>
> >> <filter-
> >> class>net.sourceforge.myfaces.custom.fileupload.MultipartFilter</
> >> filter-class>
> >>          <init-param>
> >>              <param-name>maxFileSize</param-name>
> >>              <param-value>10m</param-value>
> >>              <description>Set the size limit for uploaded files.
> >>                  Format: 10 - 10 bytes
> >>                          10k - 10 KB
> >>                          10m - 10 MB
> >>              </description>
> >>          </init-param>
> >>      </filter>
> >>
> >>  and if you doesn't put  multipart/form-data in you form it's
> >> normalthat you
> >> have a null value because the multipartFilter is not calledto.
> >>
> >>  Le 17 nov. 04, à 16:41, Alecsandru Chirosca a écrit :
> >>
> >>
> >>  Hi list,
> >>
> >>
> >>  I have a problem width the fileUpload component, when I
> >> usemultipart/form-data my form does noting (the button that connects
> >> tothe
> >> upload() function from my bean does nothing. When I remove
> >> themultipart/form-data encoduing declaration from the h:form element
> >> theupload() function gets called but I hane null value in
> >> theupploadedFile
> >> property.
> >>
> >>
> >>  Anyone had this problem?
> >>  the page is quite large and includes a lot of HTML code.
> >>
> >>  Any ideea will be apreciated.
> >>
> >>
> >>  Best regards,
> >>  Alecs
> >>
> >>  --
> >>  Nicolas Arni-Bloch
> >>  Groupe MATIS-Bd, Centre Universitaire d'Informatique
> >>  24 rue General-Dufour
> >>  CH-1205 Genève
> >>  eMail : nicolas.arni-bloch@cui.unige.ch
> >>  phone : +41 22 379 76 80
> >>  fax : +41 22 379 77 80
> >
> >
> --
> Nicolas Arni-Bloch
> Groupe MATIS-Bd, Centre Universitaire d'Informatique
> 24 rue General-Dufour
> CH-1205 Genève
> eMail : nicolas.arni-bloch@cui.unige.ch
> phone : +41 22 379 76 80
> fax : +41 22 379 77 80
> 
>

Re: FileUploadProblem

Posted by Nicolas Arni-Bloch <Ni...@cui.unige.ch>.
I'm using oracle to with blob and I know this *&%& 4kb limitation,
can you send the java code and maybe some error ?
Le 18 nov. 04, à 09:42, Martin Marinschek a écrit :

> strange... I don't have any problems with file-upload, using it every  
> day...
>
> just to tell you: the 4kB restriction in oracle is something you can
> work around, if need be
>
> regards,
>
> Martin
>
>
> On Thu, 18 Nov 2004 09:41:21 +0200, Alecsandru Chirosca
> <al...@comtec.ro> wrote:
>>  Hi,
>>
>>  Here are the informations you requested.
>>
>>
>>  The 4k limitation to fileupload is due Oracle BLOB handling  
>> limitation.
>>
>>  Here are the relevant parts of web.xml :
>>    <filter>
>>      <filter-name>multipartFilter</filter-name>
>>
>> <filter- 
>> class>net.sourceforge.myfaces.custom.fileupload.MultipartFilter</ 
>> filter-class>
>>      <init-param>
>>          <param-name>maxFileSize</param-name>
>>          <param-value>4k</param-value>
>>          <description>limita de upload la fisiere</description>
>>      </init-param>
>>    </filter>
>>  ......
>>  <filter-mapping>
>>      <filter-name>multipartFilter</filter-name>
>>      <url-pattern>*.jsp</url-pattern>
>>  </filter-mapping>
>>
>>
>>  and from our jsp page :
>>  .....
>>              <jh:form id="form1" name="form1"  
>> enctype="multipart/form-data">
>>                  <jh:panelGrid id="pg1"
>>                      cellspacing="0px" columns="1"  
>> styleClass="bodyClass"
>>                      columnClasses="bodyTDLeft,bodyTDright">
>>                      <jc:facet name="header">
>>                          <jh:graphicImage
>> url="/afiseazaSigla?imagine=#{editorSigla.societatea.id}"
>>                          alt="imagine indisponibila"/>
>>                              <!-- this is an image display servlet -->
>>                      </jc:facet>
>>                      <je:inputFileUpload id="aUpload"
>>                          value="#{editorSigla.siglaNoua}"
>>                          storage="file"
>>                          accept="image/*"/>
>>                      <jc:facet name="footer">
>>                          <jh:commandButton id="trimiteimaginea"
>> value="trimite" action="#{editorSigla.modifica}"/>
>>                      </jc:facet>
>>                  </jh:panelGrid>
>>              </jh:form>
>>  .....
>>
>>
>>  The problem is that the procedure editorSigla.modifica does not get  
>> called
>> at all when using multipart/form-data encoding.
>>
>>
>>  Best regards,
>>  Alecs
>>
>>
>>
>>  On Wed, 2004-11-17 at 17:58, Nicolas Arni-Bloch wrote:
>>  Are sure that the multipartFilter is enable ? Normally you must  
>> havesome
>> think like this in your web.xml (and uncommented)
>>
>>
>>  <filter>
>>          <filter-name>multipartFilter</filter-name>
>>
>> <filter- 
>> class>net.sourceforge.myfaces.custom.fileupload.MultipartFilter</ 
>> filter-class>
>>          <init-param>
>>              <param-name>maxFileSize</param-name>
>>              <param-value>10m</param-value>
>>              <description>Set the size limit for uploaded files.
>>                  Format: 10 - 10 bytes
>>                          10k - 10 KB
>>                          10m - 10 MB
>>              </description>
>>          </init-param>
>>      </filter>
>>
>>  and if you doesn't put  multipart/form-data in you form it's  
>> normalthat you
>> have a null value because the multipartFilter is not calledto.
>>
>>  Le 17 nov. 04, à 16:41, Alecsandru Chirosca a écrit :
>>
>>
>>  Hi list,
>>
>>
>>  I have a problem width the fileUpload component, when I
>> usemultipart/form-data my form does noting (the button that connects  
>> tothe
>> upload() function from my bean does nothing. When I remove
>> themultipart/form-data encoduing declaration from the h:form element
>> theupload() function gets called but I hane null value in  
>> theupploadedFile
>> property.
>>
>>
>>  Anyone had this problem?
>>  the page is quite large and includes a lot of HTML code.
>>
>>  Any ideea will be apreciated.
>>
>>
>>  Best regards,
>>  Alecs
>>
>>  --
>>  Nicolas Arni-Bloch
>>  Groupe MATIS-Bd, Centre Universitaire d'Informatique
>>  24 rue General-Dufour
>>  CH-1205 Genève
>>  eMail : nicolas.arni-bloch@cui.unige.ch
>>  phone : +41 22 379 76 80
>>  fax : +41 22 379 77 80
>
>
--
Nicolas Arni-Bloch               						
Groupe MATIS-Bd, Centre Universitaire d'Informatique
24 rue General-Dufour
CH-1205 Genève
eMail : nicolas.arni-bloch@cui.unige.ch
phone : +41 22 379 76 80
fax : +41 22 379 77 80


Re: FileUploadProblem

Posted by Martin Marinschek <ma...@gmail.com>.
strange... I don't have any problems with file-upload, using it every day...

just to tell you: the 4kB restriction in oracle is something you can
work around, if need be

regards,

Martin


On Thu, 18 Nov 2004 09:41:21 +0200, Alecsandru Chirosca
<al...@comtec.ro> wrote:
>  Hi,
>  
>  Here are the informations you requested.
>  
>  
>  The 4k limitation to fileupload is due Oracle BLOB handling limitation.
>  
>  Here are the relevant parts of web.xml :
>    <filter>
>      <filter-name>multipartFilter</filter-name>
>     
> <filter-class>net.sourceforge.myfaces.custom.fileupload.MultipartFilter</filter-class>
>      <init-param>
>          <param-name>maxFileSize</param-name>
>          <param-value>4k</param-value>
>          <description>limita de upload la fisiere</description>
>      </init-param>
>    </filter>
>  ......
>  <filter-mapping>
>      <filter-name>multipartFilter</filter-name>
>      <url-pattern>*.jsp</url-pattern>
>  </filter-mapping>
>  
>  
>  and from our jsp page : 
>  .....
>              <jh:form id="form1" name="form1" enctype="multipart/form-data">
>                  <jh:panelGrid id="pg1" 
>                      cellspacing="0px" columns="1" styleClass="bodyClass"
>                      columnClasses="bodyTDLeft,bodyTDright">
>                      <jc:facet name="header">
>                          <jh:graphicImage
> url="/afiseazaSigla?imagine=#{editorSigla.societatea.id}"
>                          alt="imagine indisponibila"/>
>                              <!-- this is an image display servlet --> 
>                      </jc:facet>
>                      <je:inputFileUpload id="aUpload" 
>                          value="#{editorSigla.siglaNoua}"
>                          storage="file"
>                          accept="image/*"/>
>                      <jc:facet name="footer">
>                          <jh:commandButton id="trimiteimaginea"
> value="trimite" action="#{editorSigla.modifica}"/>
>                      </jc:facet>
>                  </jh:panelGrid>                                
>              </jh:form>
>  .....
>  
>  
>  The problem is that the procedure editorSigla.modifica does not get called
> at all when using multipart/form-data encoding.
>  
>  
>  Best regards, 
>  Alecs
>  
>  
>  
>  On Wed, 2004-11-17 at 17:58, Nicolas Arni-Bloch wrote: 
>  Are sure that the multipartFilter is enable ? Normally you must havesome
> think like this in your web.xml (and uncommented) 
> 
> 
>  <filter>
>          <filter-name>multipartFilter</filter-name>
>        
> <filter-class>net.sourceforge.myfaces.custom.fileupload.MultipartFilter</filter-class>
>          <init-param>
>              <param-name>maxFileSize</param-name>
>              <param-value>10m</param-value>
>              <description>Set the size limit for uploaded files.
>                  Format: 10 - 10 bytes
>                          10k - 10 KB
>                          10m - 10 MB
>              </description>
>          </init-param>
>      </filter>
>  
>  and if you doesn't put  multipart/form-data in you form it's normalthat you
> have a null value because the multipartFilter is not calledto.
>  
>  Le 17 nov. 04, à 16:41, Alecsandru Chirosca a écrit :
>  
>  
>  Hi list,
>  
>  
>  I have a problem width the fileUpload component, when I
> usemultipart/form-data my form does noting (the button that connects tothe
> upload() function from my bean does nothing. When I remove
> themultipart/form-data encoduing declaration from the h:form element
> theupload() function gets called but I hane null value in theupploadedFile
> property. 
> 
> 
>  Anyone had this problem? 
>  the page is quite large and includes a lot of HTML code.
>  
>  Any ideea will be apreciated.
>  
>  
>  Best regards,
>  Alecs 
> 
>  --
>  Nicolas Arni-Bloch               
>  Groupe MATIS-Bd, Centre Universitaire d'Informatique
>  24 rue General-Dufour
>  CH-1205 Genève
>  eMail : nicolas.arni-bloch@cui.unige.ch
>  phone : +41 22 379 76 80
>  fax : +41 22 379 77 80

Problems with client side state saving

Posted by Arinaya <ar...@realidea.ca>.
Hi all,
 
I have two fairly serious problems with client side state saving right now.
 
1. inputCalendar does not work when renderAsPopup=true. It gives an error
about duplicate component IDs (I assume MyFaces assigns the same ID to the
input field and the associated button).
 
2. commandLinks nested within a dataTable -- each link is enclosed in an
h:form, one per row. This causes an error,
"'elements.data:_id22:_link_hidden_' is null or not an object", where "id22"
corresponds to the h:form(s). I assume then that I need to explicitly
declare a unique id for each of the forms. I tried using rowIndexVar on the
datatable, and it does not work.
 
... rowIndexVar = "i" ...
 
<h:form id="#{i}">...
 
java.lang.IllegalArgumentException: #{i}

Am I doing something wrong?
 
Neither of these problems are an issue when state is saved on the server,
however this is not an option for me as I need the browser back button to
work as expected.
 
Is the issue with inputCalendar known? Has anyone worked around it?
 
Thanks for all your help guys.
 
--Arinaya

RE: message tag

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
Chris,
 
this is generell in JSF (see [Bergsten] )
 
the component tree does not know a component with ID=rayon,
when I comes first to <x:message/>.
 
 
Bergsten: http://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html
 
 
 
-Matthias 
 
 -----Original Message-----
From: christian.rueedi@globus.ch [mailto:christian.rueedi@globus.ch] 
Sent: Thursday, November 18, 2004 9:10 AM
To: MyFaces Discussion
Subject: x:message tag




Hi there, 

I played around with the messages tag. I realised, that it is not
possible to set a x:message tag 
before the input tag which it is referencing to. Like this: 

<x:message for="rayon" detailFormat="*" styleClass="ErrorText" /> 
<h:inputText id="rayon" styleClass="FieldForm NormalText TextLeftAlign"
value="#{WVSForm.a_WVSObject.a_Rayon}"> 
  <f:validateLongRange minimum="0" maximum="9999"/> 
</h:inputText> 

Error: Can't find Component"rayon" 

It works if I set the x:message tag after the input tag: 

<h:inputText id="rayon" styleClass="FieldForm NormalText TextLeftAlign"
value="#{WVSForm.a_WVSObject.a_Rayon}"> 
  <f:validateLongRange minimum="0" maximum="9999"/> 
</h:inputText> 
<x:message for="rayon" detailFormat="*" styleClass="ErrorText" /> 


But on the other hand, in the x:dataTable it doesen't matter. both 

<h:column > 
        <x:message for="skunbr" detailFormat="*" styleClass="ErrorText"
/> 
        <h:inputText id="skunbr" value="#{sku.a_Skunbr}" required="true"
> 
          <f:validateLength minimum="8" maximum="8" /> 
        </h:inputText> 
 </h:column> 

and 

<h:column > 
        <h:inputText id="skunbr" value="#{sku.a_Skunbr}" required="true"
> 
          <f:validateLength minimum="8" maximum="8" /> 
        </h:inputText> 
        <x:message for="skunbr" detailFormat="*" styleClass="ErrorText"
/> 
</h:column> 

work perfectly. 

Now my question is: Is this correct or is this a remaining bug? 

greetz, 

 Chris 



x:message tag

Posted by ch...@globus.ch.
Hi there,

I played around with the messages tag. I realised, that it is not possible 
to set a x:message tag 
before the input tag which it is referencing to. Like this:

<x:message for="rayon" detailFormat="*" styleClass="ErrorText" />
<h:inputText id="rayon" styleClass="FieldForm NormalText TextLeftAlign" 
value="#{WVSForm.a_WVSObject.a_Rayon}">
  <f:validateLongRange minimum="0" maximum="9999"/>
</h:inputText>

Error: Can't find Component"rayon"

It works if I set the x:message tag after the input tag:

<h:inputText id="rayon" styleClass="FieldForm NormalText TextLeftAlign" 
value="#{WVSForm.a_WVSObject.a_Rayon}">
  <f:validateLongRange minimum="0" maximum="9999"/>
</h:inputText>
<x:message for="rayon" detailFormat="*" styleClass="ErrorText" />


But on the other hand, in the x:dataTable it doesen't matter. both 

<h:column >
        <x:message for="skunbr" detailFormat="*" styleClass="ErrorText" />
        <h:inputText id="skunbr" value="#{sku.a_Skunbr}" required="true" >
          <f:validateLength minimum="8" maximum="8" />
        </h:inputText>
 </h:column>

and

<h:column >
        <h:inputText id="skunbr" value="#{sku.a_Skunbr}" required="true" >
          <f:validateLength minimum="8" maximum="8" />
        </h:inputText>
        <x:message for="skunbr" detailFormat="*" styleClass="ErrorText" />
</h:column>

work perfectly.

Now my question is: Is this correct or is this a remaining bug?

greetz,

 Chris

Re: FileUploadProblem

Posted by Alecsandru Chirosca <al...@comtec.ro>.
Hi,

Here are the informations you requested.


The 4k limitation to fileupload is due Oracle BLOB handling limitation.

Here are the relevant parts of web.xml :
  <filter>
    	<filter-name>multipartFilter</filter-name>
   
	<filter-class>net.sourceforge.myfaces.custom.fileupload.MultipartFilter</filter-class>
    	<init-param>
        		<param-name>maxFileSize</param-name>
        		<param-value>4k</param-value>
        		<description>limita de upload la fisiere</description>
    	</init-param>
  </filter>
......
	<filter-mapping>
    		<filter-name>multipartFilter</filter-name>
    		<url-pattern>*.jsp</url-pattern>
	</filter-mapping>


and from our jsp page : 
.....
            <jh:form id="form1" name="form1"
enctype="multipart/form-data">
                <jh:panelGrid id="pg1" 
                    cellspacing="0px" columns="1" styleClass="bodyClass"
                    columnClasses="bodyTDLeft,bodyTDright">
                    <jc:facet name="header">
                        <jh:graphicImage
url="/afiseazaSigla?imagine=#{editorSigla.societatea.id}"
                        alt="imagine indisponibila"/>
                            <!-- this is an image display servlet --> 
                    </jc:facet>
                    <je:inputFileUpload id="aUpload" 
                        value="#{editorSigla.siglaNoua}"
                        storage="file"
                        accept="image/*"/>
                    <jc:facet name="footer">
                        <jh:commandButton id="trimiteimaginea"
value="trimite" action="#{editorSigla.modifica}"/>
                    </jc:facet>
                </jh:panelGrid>                                
            </jh:form>
.....


The problem is that the procedure editorSigla.modifica does not get
called at all when using multipart/form-data encoding.


Best regards, 
Alecs



On Wed, 2004-11-17 at 17:58, Nicolas Arni-Bloch wrote:

> Are sure that the multipartFilter is enable ? Normally you must
> havesome think like this in your web.xml (and uncommented) 
> <filter>
>         <filter-name>multipartFilter</filter-name>
>       
> <filter-class>net.sourceforge.myfaces.custom.fileupload.MultipartFilter</filter-class>
>         <init-param>
>             <param-name>maxFileSize</param-name>
>             <param-value>10m</param-value>
>             <description>Set the size limit for uploaded files.
>                 Format: 10 - 10 bytes
>                         10k - 10 KB
>                         10m - 10 MB
>             </description>
>         </init-param>
>     </filter>
> 
> and if you doesn't put  multipart/form-data in you form it's
> normalthat you have a null value because the multipartFilter is not
> calledto.
> 
> Le 17 nov. 04, � 16:41, Alecsandru Chirosca a �crit :
> 
> 
>         Hi list,
>         
>         
>         I have a problem width the fileUpload component, when I
>         usemultipart/form-data my form does noting (the button that
>         connects tothe upload() function from my bean does nothing.
>         When I remove themultipart/form-data encoduing declaration
>         from the h:form element theupload() function gets called but I
>         hane null value in theupploadedFile property. 
>         Anyone had this problem? 
>         the page is quite large and includes a lot of HTML code.
>         
>         Any ideea will be apreciated.
>         
>         
>         Best regards,
>         Alecs 
> 
> --
> Nicolas Arni-Bloch               
> Groupe MATIS-Bd, Centre Universitaire d'Informatique
> 24 rue General-Dufour
> CH-1205 Gen�ve
> eMail : nicolas.arni-bloch@cui.unige.ch
> phone : +41 22 379 76 80
> fax : +41 22 379 77 80

Re: FileUploadProblem

Posted by Nicolas Arni-Bloch <Ni...@cui.unige.ch>.
Are sure that the multipartFilter is enable ? Normally you must have  
some think like this in your web.xml (and uncommented)
  <filter>
         <filter-name>multipartFilter</filter-name>
          
<filter- 
class>net.sourceforge.myfaces.custom.fileupload.MultipartFilter</ 
filter-class>
         <init-param>
             <param-name>maxFileSize</param-name>
             <param-value>10m</param-value>
             <description>Set the size limit for uploaded files.
                 Format: 10 - 10 bytes
                         10k - 10 KB
                         10m - 10 MB
             </description>
         </init-param>
     </filter>

and if you doesn't put  multipart/form-data in you form it's normal  
that you have a null value because the multipartFilter is not called  
to.

Le 17 nov. 04, à 16:41, Alecsandru Chirosca a écrit :

>  Hi list,
>
>
>  I have a problem width the fileUpload component, when I use  
> multipart/form-data my form does noting (the button that connects to  
> the upload() function from my bean does nothing. When I remove the  
> multipart/form-data encoduing declaration from the h:form element the  
> upload() function gets called but I hane null value in the  
> upploadedFile property.
>  Anyone had this problem?
>  the page is quite large and includes a lot of HTML code.
>
>  Any ideea will be apreciated.
>
>
>  Best regards,
>  Alecs
--
Nicolas Arni-Bloch               						
Groupe MATIS-Bd, Centre Universitaire d'Informatique
24 rue General-Dufour
CH-1205 Genève
eMail : nicolas.arni-bloch@cui.unige.ch
phone : +41 22 379 76 80
fax : +41 22 379 77 80