You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by he...@sptroth.com on 2003/03/03 08:58:48 UTC

sendRedirect problem

Hi All

I have to keep a project alive, while my colleague is away... So I don't
know much about tomcat and now there comes a problem where I can't find a
solution. Maybe one of you can help me out here (I hope it is not dumb, at
least I was not able to find any helpful information on the web):

The project is realized with jsp and we are getting a strange
JasperException while executing response.sendRedirect(...)

Here is the code snippet where the exception gets thrown:

if ((request_return.length() > 0)) {
  System.out.println(sessionAddress_ProductTree + "#" + request_return);
  String temp = response.encodeUrl(sessionAddress_ProductTree + "#" +
request_return);
  System.out.println(temp);
  response.sendRedirect(temp);    // <- Here the exception happens

Remarkable is, the html file which the server sends to clients, when this
exception happens is always 16kBytes long (16384 Bytes) and then it stops
abruptly.

I'm running tomcat (stand-alone) version 4.1.18-LE-jdk14 with JDK 1.4 on
Windows 2000

Here is the Output on the server console including the exception:

AcquireDocuments.jsp#305
AcquireDocuments.jsp#305
StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw
exception
org.apache.jasper.JasperException
org.apache.jasper.JasperException
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
        at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
        at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
        at java.lang.Thread.run(Thread.java:536)

Any help?

Regards,
Herbert



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: sendRedirect problem

Posted by Bill Barker <wb...@wilshire.com>.
Is sounds like Tomcat has already started sending the output the the browser
by the time you are trying to do a sendRedirect.  At this point is is too
late to change your mind about what page you want to send.  You have to move
the logic that desides to redirect up before the first 8K of your page is
output.

<he...@sptroth.com> wrote in message
news:OF905D6429.A892E921-ONC1256CDE.002A790B-C1256CDE.002BD3D0@sptroth.com..

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org