Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-dev] Servlet 3.0 suspend / resume support

Hi Guys -

I'm trying to use Jetty 7 (M2) to write an app that does comet. I want to use the Servlet 3.0 features that are supposedly in this version of Jetty. I can't find examples on how to do this anywhere though! Does someone have some example code sitting around? I've done enough poking through the code / docs, that I'm guessing the code should look something like this...

public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 

{

Request req = Request.getRequest(request);

        AsyncRequest aReq = req.getAsyncRequest();


if(aReq.isInitial())

{

//do some stuff

        }

}


The problem here is that Request.getRequest(request) throws a null pointer exception, and after looking through the code it looks like this is because HttpConnection.getCurrentConnection(); returns null. What am I doing wrong here? How can I get a reference to a Jetty Request object?


Any help you can give me will be most appreciated! Thanks!


-Andrew


Back to the top