Spring Java Config: Tomcat deploy without web.xml

前端 未结 2 1263
终归单人心
终归单人心 2021-01-05 10:36

I built a java configured Spring MVC application without any XML. I can deploy and start the application on my laptop without any problems. But as soon as I try to deploy my

2条回答
  •  温柔的废话
    2021-01-05 11:20

    I'd upgrade to the latest Tomcat version and see if that works (to isolate your issue). There are many issues with using the new spring features (ex: java config, etc.) with older Tocmat servers. For example, see: http://docs.spring.io/autorepo/docs/spring-framework/3.1.x/javadoc-api/org/springframework/web/WebApplicationInitializer.html

    Mapping to '/' under Tomcat

    Apache Tomcat maps its internal DefaultServlet to "/", and on Tomcat versions <= 7.0.14, this >>servlet mapping cannot be overridden programmatically. 7.0.15 fixes this issue. Overriding the "/" >>servlet mapping has also been tested successfully under GlassFish 3.1.

提交回复
热议问题