tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bill cao <drop_me_an_m...@yahoo.com>
Subject Re: java.lang.IllegalStateException
Date Wed, 06 Sep 2006 18:33:43 GMT
I fixed it by adding  a 'return' statement after
pageCotext.forward(). 
Current process should terminate when forward
statement is executed. I think 
this is a bug.


----- Original Message ----- 
From: "bill cao" <drop_me_an_mail@yahoo.com>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Wednesday, September 06, 2006 11:15 AM
Subject: java.lang.IllegalStateException


>I am using Apache Tomcat/5.0.28
>
> Here is the code of traffic.jsp. it can forward to
yyyy.html with no 
> problem, but when forwarding to zzz.html, it throws 
> java.lang.IllegalStateException: getOutputStream()
has already been called 
> for this response
>
> String serverName = request.getServerName();
> if (serverName.toLowerCase().indexOf("xxxx") != -1)
> response.sendRedirect("/xxxx");
>
> else if (serverName.toLowerCase().indexOf("yyyy") !=
-1)
> pageContext.forward("yyyy.html");
>
> else if (serverName.toLowerCase().indexOf("zzzz") !=
-1)
> pageContext.forward("zzzz.html");
>
> else
> response.sendError(404);
>
> The only difference between yyyy.html and zzzz.html
is that one is bigger 
> than the other. /xxxx is also working.
> This is very strange!!! Anybody know What is going
on?
>
>
>
> ---------------------------------
> Get your email and more, right on the  new Yahoo.com



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message