How to add a RequestContextListener with no-xml configuration?

前端 未结 2 2037
清酒与你
清酒与你 2021-01-02 07:42

I need to add a listener to my Spring Boot application, in web.xml it looks like


 
    org.springframework.web.contex         


        
2条回答
  •  心在旅途
    2021-01-02 08:24

    Write your own listener class which extends from RequestContextListener and register it via annotation. Something like this:

    @WebListener
    public class MyRequestContextListener extends RequestContextListener {
    }
    

提交回复
热议问题