DispatcherServlet and web.xml in Spring Boot

后端 未结 4 1811
死守一世寂寞
死守一世寂寞 2020-12-13 04:43

I\'m currently trying to move my project from Java EE to Spring Boot project. However, i\'ve been stucked and confused on the part with dispatcher servlet and web.xml and it

4条回答
  •  渐次进展
    2020-12-13 05:31

    1. You can keep your web.xml, but it needs to add

      
           org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener
       
      

      in web.xml. And, required dependency of pom.xml.

    2. All listener classes, filters converts in Java class. This class would be @Configuration.

    3. If you have an interceptor, that can be moved to configuration class.

提交回复
热议问题