tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <devli...@hanik.com>
Subject Re: Comet: response.sendRedirect() Problem
Date Wed, 07 Nov 2007 17:13:43 GMT
there is a bug in 6.0.14 regarding pipelining HTTP events on a comet 
connection, your code is correct, try with our current release candidate
http://people.apache.org/~remm/tomcat-6/v6.0.15/bin/

Filip

Jens Hagel wrote:
> Hello,
>
> I'm trying to use the sendRedirect() function in the begin event of a
> simple CometServlet,
> but nothing happens. Does anyone has an idea what's going wrong?
>
> kind regards,
> jens hagel
>
> ------------------
> import org.apache.catalina.CometProcessor;
> import org.apache.catalina.CometEvent;
>
> import javax.servlet.http.*;
> import javax.servlet.ServletException;
> import java.io.IOException;
>
> public class CometServlet extends HttpServlet implements CometProcessor {
>
>     public void event(CometEvent cometEvent) throws IOException,
> ServletException {
>
>         HttpServletResponse response = cometEvent.getHttpServletResponse();
>
>         // don't want timeout events
>         cometEvent.setTimeout(1000000);
>
>         if (cometEvent.getEventType() == CometEvent.EventType.BEGIN) {
>
>             log("Begin for session");
>             response.sendRedirect("http://www.heise.de");
>             cometEvent.close();
>
>         } else if (cometEvent.getEventType() == CometEvent.EventType.ERROR) {
>             log("Error for session: " + cometEvent.getEventSubType());
>             cometEvent.close();
>         } else if (cometEvent.getEventType() == CometEvent.EventType.END) {
>             log("End for session");
>             cometEvent.close();
>         } else if (cometEvent.getEventType() == CometEvent.EventType.READ) {
>             log("Read for session");
>         }
>     }
> }
> -----------------
>
> ---------------------------------------------------------------------
> 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
>
>
>
>   


---------------------------------------------------------------------
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