Spring 3.1 WebApplicationInitializer & Embedded Jetty 8 AnnotationConfiguration

后端 未结 13 1160
無奈伤痛
無奈伤痛 2020-12-13 14:16

I\'m trying to create a simple webapp without any XML configuration using Spring 3.1 and an embedded Jetty 8 server.

However, I\'m struggling to get Jetty to recogni

13条回答
  •  误落风尘
    2020-12-13 14:28

    Based on my testing and this thread http://forum.springsource.org/showthread.php?127152-WebApplicationInitializer-not-loaded-with-embedded-Jetty I don't think it works at the moment. If you look in AnnotationConfiguration.configure:

       parseContainerPath(context, parser);
       // snip comment
       parseWebInfClasses(context, parser);
       parseWebInfLib (context, parser);
    

    it seems coupled to a war-like deployment rather than embedded.

    Here is an example using Spring MVC and embedded Jetty that might be more useful:

    http://www.jamesward.com/2012/08/13/containerless-spring-mvc

    It creates the Spring servlet directly rather then relying on annotations.

提交回复
热议问题