Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » jetty 7 continuation help!(suspend not working!)
icon8.gif  jetty 7 continuation help! [message #672495] Sat, 21 May 2011 10:00 Go to next message
ravi  is currently offline ravi Friend
Messages: 4
Registered: April 2011
Junior Member
Hi,

i'm using jetty-7.4.1.v20110513 and servlet-api-2.5

i tried to use continations in the following servlet.

import java.io.*;
 import java.util.*;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
  
 import org.eclipse.jetty.continuation.*;
 


public class cs extends HttpServlet {

public void service(HttpServletRequest req, HttpServletResponse res)
throws java.io.IOException {

String reqId = req.getParameter("id");

Continuation cc = ContinuationSupport.getContinuation(req);

res.setContentType("text/plain");
res.getWriter().println("Request: "+reqId+"\tstart:\t"+new Date());
res.getWriter().flush();

cc.setTimeout(2000);
cc.suspend();

res.getWriter().println("Request: "+reqId+"\tend:\t"+new Date());
cc.complete();
}
}


I'm expecting a 2 sec delay but when i run the servlet from browser i'm getting output as following without any delay:

Request: null	start:	Sat May 21 15:25:02 IST 2011
Request: null	end:	Sat May 21 15:25:02 IST 2011


please help.
Thanks,
ravi.



Re: jetty 7 continuation help! [message #672508 is a reply to message #672495] Sat, 21 May 2011 12:40 Go to previous messageGo to next message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

Do you get the delay when you deploy independently of Eclipse? This
really isn't much of an Eclipse question. You could try one of the
forums on javaranch.com. Or, you might get some help in the Eclipse
webtools forum.


On 2011.05.21 4:00, ravi wrote:
> Hi,
>
> i'm using jetty-7.4.1.v20110513 and servlet-api-2.5
>
> i tried to use continations in the following servlet.
>
> [snip]
>
> I'm expecting a 2 sec delay but when i run the servlet from browser i'm
> getting output as following without any delay:
>
> Request: null start: Sat May 21 15:25:02 IST 2011
> Request: null end: Sat May 21 15:25:02 IST 2011
>
> please help.
> Thanks,
> ravi.
Re: jetty 7 continuation help! [message #673457 is a reply to message #672508] Mon, 23 May 2011 17:33 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
On 5/21/11 8:40 AM, Russell Bateman wrote:
> Do you get the delay when you deploy independently of Eclipse? This
> really isn't much of an Eclipse question. You could try one of the
> forums on javaranch.com. Or, you might get some help in the Eclipse
> webtools forum.

Jetty uses a mailing list (as opposed to a web forum group) for user
discussions. See https://dev.eclipse.org/mailman/listinfo/jetty-users

Eric


> On 2011.05.21 4:00, ravi wrote:
>> Hi,
>>
>> i'm using jetty-7.4.1.v20110513 and servlet-api-2.5
>>
>> i tried to use continations in the following servlet.
>>
>> [snip]
>>
>> I'm expecting a 2 sec delay but when i run the servlet from browser i'm
>> getting output as following without any delay:
>>
>> Request: null start: Sat May 21 15:25:02 IST 2011
>> Request: null end: Sat May 21 15:25:02 IST 2011
>>
>> please help.
>> Thanks,
>> ravi.
>
Previous Topic:Save and refresh?
Next Topic:RSE and Aptana upload forced to sub-folder
Goto Forum:
  


Current Time: Fri Apr 26 13:20:43 GMT 2024

Powered by FUDForum. Page generated in 0.05382 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top