You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Ronald Klop (Mailing List)" <ro...@base.nl> on 2011/12/01 13:17:42 UTC

timeout exception is ignored?

Hi,

 The method org.apache.catalina.connector.Request.parseParameters() contains this code.

                try {
                     if (readPostBody(formData, len) != len) {
                         return;
                     }
                 } catch (IOException e) {
                     // Client disconnect
                     if (context.getLogger().isDebugEnabled()) {
                         context.getLogger().debug(
                                 sm.getString("coyoteRequest.parseParameters"), e);
                     }
                     return;
                 }

 When there is a timeout exception during reading of the postbody it is ignored and my servlet runs without parameters. Why is this? Why don't I get the exception in my code, so I can handle it?

 Ronald.

Re: timeout exception is ignored?

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/12/1 Ronald Klop (Mailing List) <ro...@base.nl>:
> Hi,
>
> The method org.apache.catalina.connector.Request.parseParameters() contains
> this code.
>
>               try {
>                    if (readPostBody(formData, len) != len) {
>                        return;
>                    }
>                } catch (IOException e) {
>                    // Client disconnect
>                    if (context.getLogger().isDebugEnabled()) {
>                        context.getLogger().debug(
>
>  sm.getString("coyoteRequest.parseParameters"), e);
>                    }
>                    return;
>                }
>
> When there is a timeout exception during reading of the postbody it is
> ignored and my servlet runs without parameters. Why is this? Why don't I get
> the exception in my code, so I can handle it?
>

Simply because getParameter**() methods in ServletRequest as defined
by Servlet specification do not support throwing exceptions at all,
nor there are any provisions to rethrow them again on second
getParameter**() call if first one resulted in a failure.

(Compare that to getPart() method in Servlet 3.0 spec)


In latest 7.0 release I added indication of such failures using a
custom request attribute - see changelog. This feature will be in
upcoming 6.0.35 as well.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org