You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ashish Kulkarni <ku...@yahoo.com> on 2002/08/09 18:38:32 UTC

jsp include question

Hi

I am developing a web application and came accross
this problem.
when in my jsp page i have <jsp:include> runtime
include and then later in the code when i have
response.sendRedirect or
request.getRequestDispatcher() to forward the jsp page
i get error saying the
java.lang.IllegalStateException: Response has already
been committed.
but when i use <%@ %> compile time include i  dont get
this error, 
Can some one explain the why
Ashish

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: jsp include question

Posted by Jose Francisco Junior <jj...@zipmail.com>.
If you want to redirect the request you have to do it
 before printing any other thing on the page.

Example:

it works:

<redirect code here>

<html>
<head>
...
</head>
...

it does not work:

<html>
<head>
...
</head>

<redirect code here>
...
On Fri, 9 Aug 2002 09:38:32 -0700 (PDT)
Ashish Kulkarni <ku...@yahoo.com> wrote:
>Hi
>
>I am developing a web application and came accross
>this problem.
>when in my jsp page i have <jsp:include> runtime
>include and then later in the code when i have
>response.sendRedirect or
>request.getRequestDispatcher() to forward the jsp page
>i get error saying the
>java.lang.IllegalStateException: Response has already
>been committed.
>but when i use <%@ %> compile time include i  dont get
>this error, 
>Can some one explain the why
>Ashish
>
>__________________________________________________
>Do You Yahoo!?
>HotJobs - Search Thousands of New Jobs
>http://www.hotjobs.com
>
>--
>To unsubscribe, e-mail:
>   <ma...@jakarta.apache.org>
>For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>

-----------------------------------------
Prefiro as lágrimas da derrota
do que a vergonha de não ter lutado... 

Willan Brook
-----------------------------------------
________________________________________________
Don't E-Mail, ZipMail! http://www.zipmail.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>