I have an application where you login and see a menu of things to do and
items you have registered.
When the user logs in I use redirect=true in the action to send him to the
menu. I do this to prevent "This page has expired" when the user presses
back button later when browsing to get back to the main menu.
I was getting This page has expired because I have no-cache=true.
Now however I am getting the following exception quite a lot.
java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at org.apache.jk.common.ChannelSocket.send(ChannelSocket.java:407)
at
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:599)
at
org.apache.jk.server.JkCoyoteHandler.action(JkCoyoteHandler.java:372)
at org.apache.coyote.Response.action(Response.java:222)
at org.apache.coyote.Response.finish(Response.java:343)
at
org.apache.coyote.tomcat4.OutputBuffer.close(OutputBuffer.java:326)
at
org.apache.coyote.tomcat4.CoyoteResponse.finishResponse(CoyoteResponse.java:500)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:224)
at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261)
at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360)
at
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604)
at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:562)
at
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:679)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:536)
This is, to my best knowledge, pretty harmless. Only means the browser has
cut the connection before the response has been fully received. (i.e.
pressing 'back' or 'stop'). However I would like to be able to catch this
exception and deal with it in a more propper manner than printing it's
stacktrace in my logs. How do I go about doing this?
Best regards!
Bjorn I