We could drop something into the request and check for that value later. Since this message is more a global message I´m currently not sure where we should add them to the facescontext messages. Be could do this when building the facescontext.
AFAIK the code currently checks the size of the whole response. If a user has more than one upload in the page things can get tricky. The value which can be specified for the filter is not a value for a single file size. It´s more a limit how much data can be send at once through a multipartrequest. I think it is better to use the maxlength attribute of the component to validate the uploaded file size. I´ve committed a fix for it since since the existing solution depends on the browser which might not handle the maxlength attribute correctly and still send larger files. The component now validates the size of the uploaded file on server side. 2005/11/5, Martin Marinschek <[EMAIL PROTECTED]>: > Yes - it would be a normal validation message - the problem is to get > it from the filter down to the application, there is no standardized > way to do so. > > regards, > > Martin > > On 11/5/05, Robert Parsons <[EMAIL PROTECTED]> wrote: > > Should it possibly appear as if a normal validation exception? Have a > > fileSizeValidator? I dont really know how validators work, just a > > suggestion. > > > > > > > > Martin Marinschek wrote: > > That is an old problem we haven't resolved yet. > > > > What we should do is set a request parameter I think - and on decode, > > the fileUpload component checks this request parameter and adds a > > message. > > > > What do you think? > > > > regards, > > > > Martin > > > > On 11/3/05, Dave <[EMAIL PROTECTED]> wrote: > > > > > > I am using FileUpload. In case that file is too large, I like to display a > > message, but I got the following exception during Restore View phase. How > > should I catch the exception and display a message? Thanks! > > > > 01:14:14,156 INFO [MultipartRequestWrapper] 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 exce > > eds allowed range > > at > > org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:317) > > at > > org.apache.myfaces.component.html.util.MultipartRequestWrapper.parseRequest(MultipartRequestWrapper.java:70) > > at > > org.apache.myfaces.component.html.util.MultipartRequestWrapper.getParameter(MultipartRequestWrapper.java:151) > > at > > org.apache.myfaces.context.servlet.RequestParameterMap.getAttribute(RequestParameterMap.java:39) > > at > > org.apache.myfaces.context.servlet.AbstractAttributeMap.get(AbstractAttributeMap.java:87) > > at > > org.apache.myfaces.application.jsp.JspStateManagerImpl.getSerializedViewFromServletSession(JspStateManagerImp > > l.java:356) > > at > > org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreTreeStructure(JspStateManagerImpl.java:182) > > at > > org.apache.myfaces.application.jsp.JspStateManagerImpl.restoreView(JspStateManagerImpl.java:207) > > at > > org.apache.myfaces.application.jsp.JspViewHandlerImpl.restoreView(JspViewHandlerImpl.java:255) > > at > > org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:120) > > at > > org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:67) > > .... > > > > > > ________________________________ > > Yahoo! FareChase - Search multiple travel sites in one click. > > > > > > > > > > -- > > > > http://www.irian.at > > Your JSF powerhouse - > > JSF Trainings in English and German > > > > > > > > > > > > > -- > > http://www.irian.at > Your JSF powerhouse - > JSF Trainings in English and German > -- Mathias

