you can't know until you request the resource.

ie, a timeout can happen at point X, 2 min later, the application does getOutputStream.print, and receives an IOException, obviously the timeout happened X+20sec, not X+2min, so no, no real way to know.

for your filter to know that "a ioexception" happened, you'd have to wrap the intputstream,reader,outputstream,writer to catch ioexceptions from tomcat

Filip

Alex Epshteyn wrote:
Say I have the following filter which is responsible for timing all requests
in my application:

public void doFilter(ServletRequest request, ServletResponse response,
FilterChain filterChain) throws IOException, ServletException {
    startTiming(request, response);
    filterChain.doFilter(request, response);
    stopTimingAndLogTime(request, response);
}

The problem is that if the delegated servlet gets a connection timeout, my
filter doesn't know about it, and prints a value like 20000 ms in the logs
(whatever the HTTP Connector's connectionTimeout attribute is set to).

Is there any way for my filter to know that a connection has timed out, so I
can exclude these requests from my timing statistics?  I haven't been able
to find much info about how this is implemented.

Thanks,
Alex


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to