You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sundaram Ramasamy <su...@percipia.com> on 2001/04/12 22:46:38 UTC
Response has already been committed
Hi,
>From servlet I am forwarding jsp page like this,
/**
* Check for user logon
*/
if( req.getAttribute(name) == null ) {
System.out.println("user is not logged on");
getServletConfig().getServletContext().getRequestDispatcher(page).forward(re
q, res);
}
its giving me a error:
2001-04-12 04:39:40 - Ctx( /employee ): Servlet API error: sendError with
commited buffer
2001-04-12 04:39:40 - Ctx( /employee ): IllegalStateException in: R(
/employee +
/logon.jsp + null) Response has already been committed
any idea why I am getting this error.
Re: Response has already been committed
Posted by Stanley Tan <st...@crosswinds.net>.
I'm not so sure about this. I believe that you have already sent data to
the user. You cannot forward a page after you have sent data to the
user. For example, after setting the content type and sending something to
the user, and then trying to forward a page, you'll get an
IllegalStateException as you did below.
Did you already commit content to the user?
Hope this helps.
Stanley Tan
[Struts Newbie]
At 04:46 PM 4/12/01 -0400, you wrote:
>Hi,
>
> >From servlet I am forwarding jsp page like this,
>
>
> /**
> * Check for user logon
> */
>
> if( req.getAttribute(name) == null ) {
> System.out.println("user is not logged on");
>
>getServletConfig().getServletContext().getRequestDispatcher(page).forward(re
>q, res);
> }
>
>its giving me a error:
>
>2001-04-12 04:39:40 - Ctx( /employee ): Servlet API error: sendError with
>commited buffer
>2001-04-12 04:39:40 - Ctx( /employee ): IllegalStateException in: R(
>/employee +
> /logon.jsp + null) Response has already been committed
>
>any idea why I am getting this error.
>
>