• Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.1-incubating-core-SNAPSHOT
    • Fix Version/s: 1.0.8-core, 1.2.8-core
    • Component/s: None
    • Labels:
    • Environment:
      All, commons-upload


      Trinidad/commons-upload assume some memory and space limits for uploads which can be configured in /WEB-INF/web.xml:


      When the larger of these two values is exceeded, trinidad just trows an EOFException. What the user sees in the browser is this:
      HTTP ERROR: 500

      Per-request disk space limits exceeded.

      Caused by: Per-request disk space limits exceeded.
      at org.apache.myfaces.trinidadinternal.webapp.UploadedFileImpl.loadFile(
      at org.apache.myfaces.trinidadinternal.webapp.UploadedFileProcessorImpl.processFile(
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doUploadFile(
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(
      at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(
      at org.mortbay.jetty.servlet.ServletHandler.handle(
      at org.mortbay.jetty.servlet.SessionHandler.handle(
      at org.mortbay.jetty.handler.ContextHandler.handle(
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(
      at org.mortbay.jetty.handler.HandlerCollection.handle(
      at org.mortbay.jetty.handler.HandlerWrapper.handle(
      at org.mortbay.jetty.Server.handle(
      at org.mortbay.jetty.HttpConnection.handleRequest(
      at org.mortbay.jetty.HttpConnection$RequestHandler.content(
      at org.mortbay.jetty.HttpParser.parseNext(
      at org.mortbay.jetty.HttpParser.parseAvailable(
      at org.mortbay.jetty.HttpConnection.handle(
      at org.mortbay.thread.BoundedThreadPool$

      Powered by Jetty://

      It is possible to add a "validator" attribute to a tr:inputFile component. However, that validator is only invoked when the upload size is smaller than the limits and the upload succeeds. I believe these limits really do make sense but a 500 plus stacktrace is not very cool. I propose that trinidad writes a FacesMessage to the FacesContext for the inputFile component and re-renders the same page, so the user sees the normal page again with a meaningful error message. The error message should be configurable/localizable.

      I don't know much about uploading things. Maybe it's also possible to determine the upload size before having received any data and then invoke the validator before receiving the data, so the developer could for example apply different size limits based on the mime-type of the upload. The inputFile component had to be extended to contain the same information as the valueChangeListener of the inputFile component received on its invocation.





            • Assignee:
              matzew Matthias We├čendorf
              phuber Patrick Huber
            • Votes:
              1 Vote for this issue
              0 Start watching this issue


              • Created: