Re: Comet API Question

2008-01-11 Thread Jens Hagel
i'm catching the subevents but they don't get fired.

i've a problem with this szenario:
i need to reset some serverside variables when the user clicks the reload
button in the browser with an active hanging get request.
i therefore used the main END event for detection because the subevents
don't work for better separation. this works fine when i'm not behind a
proxy. but if i'm behind a proxy the END event is not fired (perhaps the
proxy is still holding the connection?)
do you have an idea what happens when there is a proxy between the server
and the client and how i can reset the variables?

kind regards,
jens

On 1/8/08, Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote:

 yes, uncommenting that valve in context.xml should do the trick, is it
 not firing or are you just not catching it?

 2nd question, currently it just marks the request/response as non comet,
 and then calls response.finishResponse(), this will write any left over
 bytes to the socket.

 Filip

 Jens Hagel wrote:
  Hi,
  i need to detect if the user reloads the webapp or rather if the
 connection
  gets interrupted.
  i therefore use the CometEvent.EventSubType but the events don't get
 fired.
  in the context.xml i've uncommented the CometConnectionManagerValve.
  Do I have to instantiate the ConnectionManager by myself or what's going
  wrong?
 
  2nd question: it's a little bit unclear to my what happens when i call
  cometEvent.close()
  sometimes i use it and sometimes not with no difference.. :)
 
  Kind regards,
  Jens
 
 
  
 
  No virus found in this incoming message.
  Checked by AVG Free Edition.
  Version: 7.5.516 / Virus Database: 269.17.11/1201 - Release Date:
 12/28/2007 11:51 AM
 


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




Comet API Question

2007-12-29 Thread Jens Hagel
Hi,
i need to detect if the user reloads the webapp or rather if the connection
gets interrupted.
i therefore use the CometEvent.EventSubType but the events don't get fired.
in the context.xml i've uncommented the CometConnectionManagerValve.
Do I have to instantiate the ConnectionManager by myself or what's going
wrong?

2nd question: it's a little bit unclear to my what happens when i call
cometEvent.close()
sometimes i use it and sometimes not with no difference.. :)

Kind regards,
Jens


Re: Comet: response.sendRedirect() Problem

2007-11-20 Thread Jens Hagel
Hi filip, i've patched my Tomcat.
Now, it works! Thank you! ;-)

regards,
jens

On Nov 14, 2007 6:21 PM, Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote:
 hi Jens,
 you've uncovered a bug in Tomcat. basically, Tomcat doesn't respect that
 you are calling CometEvent.close upon the BEGIN event.
 I've proposed a fix
 http://svn.apache.org/viewvc?view=revrevision=594957

 and if it is accepted it will be included in our next release which
 should be within a short timeframe.
 if you want to patch your Tomcat, the patch is at
 http://people.apache.org/~fhanik/patches/comet-begin-event-close.patch

 Filip

 Jens Hagel wrote:
  hi,
 
  i'm implementing comet support for different servlet containers in an
  ajax framework.
  with jetty and glassfish comet support it works very well, but with
  tomcat something
  is going wrong with the Servlet API sendRedirect()- function which i
  cannot figure out.
 
  do you have an idea what's going wrong?
 
  thank you!
 
  regards,
  jens
 
 



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



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



Re: Comet: response.sendRedirect() Problem

2007-11-12 Thread Jens Hagel
hi,

i'm implementing comet support for different servlet containers in an
ajax framework.
with jetty and glassfish comet support it works very well, but with
tomcat something
is going wrong with the Servlet API sendRedirect()- function which i
cannot figure out.

do you have an idea what's going wrong?

thank you!

regards,
jens



On Nov 7, 2007 6:13 PM, Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote:
 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(100);
 
  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: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 


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



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



Re: Comet: response.sendRedirect() Problem

2007-11-08 Thread Jens Hagel
Hello Filip,

I've tried it with the current release candidate but still nothing happens.

jens


On Nov 7, 2007 6:13 PM, Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote:
 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(100);
 
  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: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 


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



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



Comet: response.sendRedirect() Problem

2007-11-07 Thread Jens Hagel
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(100);

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]