myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias Wessendorf" <>
Subject [TRINIDAD] ISSUE 607 (inputFile related)
Date Mon, 14 Apr 2008 16:23:24 GMT

the bug in [1] is pretty annoying.

Currently UploadedFileImpl.loadFile(....) throws an EOFException when
we hit the limits of the upload facility.
(like file is larger than allowed).

You won't see a FacesMessage for the not happened upload,
but a error page (default or a configured custom one)
To fix this, we may perhaps do the following.

add a try/catch block around the UploadedFileImpl.loadFile(....),
which happens inside UploadedFileProcessorImpl.processFile().
                    _maxMemory - info.totalBytesInMemory,
                    _maxDiskSpace - info.totalBytesOnDisk,
    catch(EOFException ioe)
      //LOG THE EXCEPTION.....
      return new ErrorFile();

The ErrorFile class is a very simple implementation of the
UploadedFile interface and it's getLength() returns -1.
That way we ensure the lifecycle continues.... (currently not the case).

Inside the renderer (SimpleInputFileRenderer.getConvertedValue()) we
could throw a ConverterException when the
length is -1, to signal that there was an issue when doing that upload...

That way we avoid the nasty error page and we can show a FacesMessage
for the inputFile in question.

Any feedback?


Matthias Wessendorf

further stuff:
mail: matzew-at-apache-dot-org

View raw message