I use Spring MVC to implement file uploads on the internal server, and the front end is just plain HTML
<form method="POST" enctype="multipart/form-data" action="/upload">
file to upload: <input type="file" name="file"><br>
<input type="submit" value="Upload" />
</form>
Everything works fine, except when I close the browser at boot time, I will see a server throw error (you must interrupt the process before to see it)
java.io.EOFException: Unexpected EOF read on the socket
at org.apache.coyote.http11.InternalNioInputBuffer.fill(InternalNioInputBuffer.java:152)
at org.apache.coyote.http11.InternalNioInputBuffer$SocketInputBuffer.doRead(InternalNioInputBuffer.java:177)
at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:110)
at org.apache.coyote.http11.AbstractInputBuffer.doRead(AbstractInputBuffer.java:416)
at org.apache.coyote.Request.doRead(Request.java:460)
at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:338)
at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:395)
...
I wonder if there is a better way to handle the exception, or can I safely leave it as it is?
source
share