Foren

AutoLogin: response.sendError

Nikolay Khasanov, geändert vor 14 Jahren.

AutoLogin: response.sendError

New Member Beitrag: 1 Beitrittsdatum: 11.08.09 Neueste Beiträge
Hi!

I'm writing custom AutoLogin class and have a case when HTTP response with code 403 must be sent. If I use
response.sendError(HttpServletResponse.SC_FORBIDDEN, "Forbidden!");

then from user point of view it works good, but I receive exception that response has already committed.
Really already committed response is my HTTP 403 response, but filter chain is not interrupted in this case and Liferay continue processing of current request.

Well, my question is: what is the reason that there is no check if response has already committed?
I see only one place: using AutoLogin.AUTO_LOGIN_REDIRECT attribute it's possible to redirect user to another page. But I need another thing.

Thanks.