Announcement Announcement Module
Collapse
No announcement yet.
Configure bean with ordinary method instead of setter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Configure bean with ordinary method instead of setter

    Hi,

    I need to run simple application with Jetty and DWR in one Spring context. Java code looks like this:

    Code:
    Server server = new Server();		
    		
    SelectChannelConnector connector = new SelectChannelConnector();
    connector.setPort(8080);
    server.setConnectors(new Connector[] {connector});
    
    Context context = new Context(server,"/",Context.SESSIONS);
    ServletHolder dwrServletHoder = new ServletHolder(new DwrServlet());
    dwrServletHoder.setInitParameter("debug", "true");
    dwrServletHoder.setInitParameter("pollAndCometEnabled", "true");
    dwrServletHoder.setInitParameter("continuationsEnabled", "false");
    dwrServletHoder.setInitParameter("classes", "beans.TransferBean");
    context.addServlet(dwrServletHoder, "/dwr/*");
    server.setHandler(context);
    
    server.setStopAtShutdown(true);
    server.start();
    I need to use addServlet for configuring Jetty but I can't use it in Spring context

    What is the right way to translate java code above to Spring?

  • #2
    If you do a search on the forums for "adder" this has been brought up a few times.

    e.g.
    http://forum.springframework.org/showthread.php?t=22443
    http://forum.springframework.org/showthread.php?t=31058

    Comment

    Working...
    X