It looks as though you are trying to write to the output stream
(out.println(xxxx)) after you have sent the redirection.  When making your
decision use an if...else statement or something else which bypasses any
output code after you redirect your servlet.  the sendRedirect is not like a
return statement.  The servlet still processes the remaining lines.

If this isn't the case then post your code so that it's easier to diagnose
the problem.

Hope this helps!
Matt

On Tue, 3 Jul 2001, A R Krishna wrote:

> Hi All
>
>    Can any one help me in fixing the exception.  This particular exception is 
>written every time i acess this particular servlet.
>
>    I am checking for entries in database.  If entries are < 0 then the redirection 
>to another servlet takes place.  If entries are >0 then the message will be printed 
>on browser using printwriter statemebts.
>
>    I have read in some documentation saying after "sendRedirect" method call the 
>processing of that particular servlet will stop.  But here i am facing this problem
>
> [Tue Jul 03 16:08:41 PDT 2001] Exception raised in servlet: mlsb.RenameSite
> [Tue Jul 03 16:08:41 PDT 2001] java.io.IOException: Attempt to write to the output 
>stream after calling HttpServletResponse's sendRedirect method
>  at com.sun.server.servlet.http.HttpOutputStream.check(HttpOutputStream.java:355)
>  at com.sun.server.servlet.http.HttpOutputStream.print(HttpOutputStream.java:442)
>  at javax.servlet.ServletOutputStream.println(ServletOutputStream.java:252)
>  at mlsb.RenameSite.doPost(RenameSite.java:88)
>  at mlsb.RenameSite.doGet(RenameSite.java:49)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:715)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
>  at com.sun.server.ServletState.callService(ServletState.java:226)
>  at com.sun.server.ServletManager.callServletService(ServletManager.java:936)
>  at com.sun.server.http.servlet.InvokerServlet.service(InvokerServlet.java:137)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
>  at com.sun.server.ServletState.callService(ServletState.java:226)
>  at com.sun.server.ServletManager.callServletService(ServletManager.java:936)
>  at com.sun.server.ProcessingState.invokeTargetServlet(ProcessingState.java:423)
>  at com.sun.server.http.HttpProcessingState.execute(HttpProcessingState.java:79)
>  at com.sun.server.http.stages.Runner.process(Runner.java:79)
>  at com.sun.server.ProcessingSupport.process(ProcessingSupport.java:294)
>  at com.sun.server.Service.process(Service.java:204)
>  at com.sun.server.http.HttpServiceHandler.handleRequest(HttpServiceHandler.java:374)
>  at com.sun.server.http.HttpServiceHandler.handleRequest(HttpServiceHandler.java:166)
>  at com.sun.server.HandlerThread.run(HandlerThread.java:162)
>
>   Please help me in fixing this exception.
>
>   Thanks in advance
>
> Regards
> RK
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to