You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Jonathan Eric Miller <je...@uchicago.edu> on 2005/03/15 20:27:06 UTC
Behavior of inputFileUpload when uploadMaxFileSize exceeded
I found that when a user attempts to upload a file that is larger than the
uploadMaxFileSize setting for the ExtensionFilter, I receive the following
exception. What I'm wondering is if there is a way to display an error
message to the user? Currently, it just blanks out all the form fields
(normally these would be remembered) and redisplays the page without an
error message (even though I have a h:message bound to the inputFileUpload
in question).
Another thing that I noticed is that in the case where the file upload
succeeds, if you navigate back to the page with the upload control, the text
box is left blank. I'm guessing this is a browser issue because the value
attribute is set correctly. i.e. it has the file name in it. This behavior
is exhibited for both IE and Firebird.
Jon
INFO: user tried to upload a file that exceeded file-size limitations.
org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the
request was rejected because it's size exceeds allowed range
at
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:317)
at
org.apache.myfaces.component.html.util.MultipartRequestWrapper.parseRequest(MultipartRequestWrapper.java:95)
at
org.apache.myfaces.component.html.util.MultipartRequestWrapper.getParameterNames(MultipartRequestWrapper.java:170)
at
javax.servlet.ServletRequestWrapper.getParameterNames(ServletRequestWrapper.java:177)
at
com.sun.faces.context.RequestParameterMap.entrySet(ExternalContextImpl.java:679)
at java.util.AbstractMap.containsKey(Unknown Source)
at
com.sun.faces.renderkit.html_basic.FormRenderer.decode(FormRenderer.java:83)
at
javax.faces.component.UIComponentBase.decode(UIComponentBase.java:665)
at javax.faces.component.UIForm.processDecodes(UIForm.java:133)
at
javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:880)
at
javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:306)
at
com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:79)
at
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
at
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
edu.uchicago.at.alt.SessionManager.doFilter(SessionManager.java:41)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:119)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
edu.uchicago.at.servlet.http.SessionExpiredFilter.doFilter(SessionExpiredFilter.java:33)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:481)
at
org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:392)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
Re: Behavior of inputFileUpload when uploadMaxFileSize exceeded
Posted by Jonathan Eric Miller <je...@uchicago.edu>.
I found out that I was wrong here. The problem that I was running into was
that I had a table with text boxes in it and the table values were being
forgotten (or more correctly, reverted to their old values (i..e it
reverting it to the converted values rather than the submitted values)) when
there was a validation error in a text box that came before the table. At
the time, I was using the JSF RI. As far as I could tell, everything was
coded properly, so, I decided to try it with MyFaces and sure enough, it
worked fine with MyFaces (I'm glad I've figured out how to get MyFaces up
and running now, it's great for debugging). So, I think it might be a bug in
the JSF RI. I'm going to try to make a simplified test case and possibly
submit it as a bug, but, I also want to try it with a JSF RI nightly build.
Jon
----- Original Message -----
From: "Jonathan Eric Miller" <je...@uchicago.edu>
To: "MyFaces Discussion" <my...@incubator.apache.org>
Sent: Wednesday, March 16, 2005 3:50 PM
Subject: Re: Behavior of inputFileUpload when uploadMaxFileSize exceeded
> One other thing that I noticed is that it appears that if you have fields
> after a file upload field and the file upload field has required="true",
> it seems to not store the values of the later fields in the bean if no
> value is specified for the file upload field. So, it forgets those values.
> I need to test it further though, to make sure it's not something that I'm
> doing. Has anyone else seen this problem?
>
> Jon
Re: Behavior of inputFileUpload when uploadMaxFileSize exceeded
Posted by Jonathan Eric Miller <je...@uchicago.edu>.
One other thing that I noticed is that it appears that if you have fields
after a file upload field and the file upload field has required="true", it
seems to not store the values of the later fields in the bean if no value is
specified for the file upload field. So, it forgets those values. I need to
test it further though, to make sure it's not something that I'm doing. Has
anyone else seen this problem?
Jon
----- Original Message -----
From: "Jonathan Eric Miller" <je...@uchicago.edu>
To: "MyFaces User List" <my...@incubator.apache.org>
Sent: Tuesday, March 15, 2005 1:27 PM
Subject: Behavior of inputFileUpload when uploadMaxFileSize exceeded
>I found that when a user attempts to upload a file that is larger than the
>uploadMaxFileSize setting for the ExtensionFilter, I receive the following
>exception. What I'm wondering is if there is a way to display an error
>message to the user? Currently, it just blanks out all the form fields
>(normally these would be remembered) and redisplays the page without an
>error message (even though I have a h:message bound to the inputFileUpload
>in question).
>
> Another thing that I noticed is that in the case where the file upload
> succeeds, if you navigate back to the page with the upload control, the
> text box is left blank. I'm guessing this is a browser issue because the
> value attribute is set correctly. i.e. it has the file name in it. This
> behavior is exhibited for both IE and Firebird.
>
> Jon
>
> INFO: user tried to upload a file that exceeded file-size limitations.
> org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException:
> the request was rejected because it's size exceeds allowed range
> at
> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:317)
> at
> org.apache.myfaces.component.html.util.MultipartRequestWrapper.parseRequest(MultipartRequestWrapper.java:95)
> at
> org.apache.myfaces.component.html.util.MultipartRequestWrapper.getParameterNames(MultipartRequestWrapper.java:170)
> at
> javax.servlet.ServletRequestWrapper.getParameterNames(ServletRequestWrapper.java:177)
> at
> com.sun.faces.context.RequestParameterMap.entrySet(ExternalContextImpl.java:679)
> at java.util.AbstractMap.containsKey(Unknown Source)
> at
> com.sun.faces.renderkit.html_basic.FormRenderer.decode(FormRenderer.java:83)
> at
> javax.faces.component.UIComponentBase.decode(UIComponentBase.java:665)
> at javax.faces.component.UIForm.processDecodes(UIForm.java:133)
> at
> javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:880)
> at
> javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:306)
> at
> com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:79)
> at
> com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
> at
> com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at
> edu.uchicago.at.alt.SessionManager.doFilter(SessionManager.java:41)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at
> org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:119)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at
> edu.uchicago.at.servlet.http.SessionExpiredFilter.doFilter(SessionExpiredFilter.java:33)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> at
> org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:481)
> at
> org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:392)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
> at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
> at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
> at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
> at java.lang.Thread.run(Unknown Source)
>