users@jersey.java.net

Intergrating Jetty and Jersey

From: Jonathan Cook - Online <Jonathan.Cook2_at_bbc.co.uk>
Date: Thu, 6 Mar 2008 12:25:10 -0000

Does anybody know if it is possible to use Jetty and Jersey together
rather than the built in HTTPHandler that comes with Jersey. I believe
you can use Jersey with Tomcat so assumed you could use it with Jetty
which is just another web server.
 
Currently I have the following code:
          Server server = new Server(8080);
         Context context = new Context(server,"/",Context.SESSIONS);

                 
         //config.
         com.sun.ws.rest.spi.container.servlet.ServletContainer
container =
                      new
com.sun.ws.rest.spi.container.servlet.ServletContainer();
         container.init();
         
         context.addServlet(new ServletHolder(container), "/*");
        
          server.start();
 
But when the Jetty server starts it complains about no paths found. I
don't think it can find the resources successfully. Even if I pass some
init params it still doesn't work.
 
Do you know if Jersey will work with Jetty?
 
Thanks
Jonathan
 
 
 

                                           
Jonathan Cook
Software Engineer

Feeds Team
BBC Future Media & Technology (Journalism)
BC3 B1, Broadcast Centre

T: 020 800 84734 (02 84734)

 

http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.