Behavior of javax.servlet.ServletResponse#isCommitted

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Behavior of javax.servlet.ServletResponse#isCommitted

Pedro Igor Silva
Hi,

    I'm using latest build from wildfly upstream/master.

    Would like to know if there is an issue on how Undertow recognize that a response is already commited or not.

    My code is setting a header and sending an error like that

        response.setHeader(REQUIRES_AUTHENTICATION_HEADER_NAME, AUTHENTICATION_SCHEME_NAME);
        response.sendError(HttpServletResponse.SC_UNAUTHORIZED);

    and isCommited is always returning "false" after that. To change this behavior I have to force a flush, so isCommited returns true.

    Both WildFly 8.1.0.Final and EAP behave differently and isCommited returns "true" without requiring a manual flush. Is this an issue ?

Regards.
Pedro Igor
_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev
Reply | Threaded
Open this post in threaded view
|

Re: Behavior of javax.servlet.ServletResponse#isCommitted

Stuart Douglas
It should be fixed in the latest Undertow build, which should make it into Wildfly upstream shortly.

On Wed, Oct 22, 2014 at 1:53 AM, Pedro Igor Silva <[hidden email]> wrote:
Hi,

    I'm using latest build from wildfly upstream/master.

    Would like to know if there is an issue on how Undertow recognize that a response is already commited or not.

    My code is setting a header and sending an error like that

        response.setHeader(REQUIRES_AUTHENTICATION_HEADER_NAME, AUTHENTICATION_SCHEME_NAME);
        response.sendError(HttpServletResponse.SC_UNAUTHORIZED);

    and isCommited is always returning "false" after that. To change this behavior I have to force a flush, so isCommited returns true.

    Both WildFly 8.1.0.Final and EAP behave differently and isCommited returns "true" without requiring a manual flush. Is this an issue ?

Regards.
Pedro Igor
_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev


_______________________________________________
wildfly-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/wildfly-dev