Since interceptor is a bean, you can simply autowire it:
@Autowired
ServletContext context;
More Related Contents:
- How to use Session attributes in Spring-mvc
- ContentCachingResponseWrapper Produces Empty Response
- Why does Spring MVC respond with a 404 and report “No mapping found for HTTP request with URI […] in DispatcherServlet”?
- How to handle static content in Spring MVC?
- Serving static web resources in Spring Boot & Spring Security application
- Setting Precedence of Multiple @ControllerAdvice @ExceptionHandlers
- What is recommended way for spawning threads from a servlet in Tomcat
- Spring MVC: How to return image in @ResponseBody?
- Spring MVC: Validation, Post-Redirect-Get, Partial Updates, Optimistic Concurrency, Field Security
- @ModelAttribute annotation, when to use it?
- CharacterEncodingFilter don’t work together with Spring Security 3.2.0
- Spring mvc @PathVariable
- Spring get current ApplicationContext
- How to create a Spring Interceptor for Spring RESTful web services
- No Spring WebApplicationInitializer types detected on classpath
- Why does Spring MVC need at least two contexts?
- Dynamic Selection Of JsonView in Spring MVC Controller
- StrictHttpFirewall in spring security 4.2 vs spring MVC @MatrixVariable
- Can Spring MVC handle multivalue query parameter?
- How to configure Spring Security to allow Swagger URL to be accessed without authentication
- Load different application.yml in SpringBoot Test
- Which is better, return “ModelAndView” or “String” on spring3 controller
- Web-application context/ root application context and transaction manager setup
- Http Post with request content type form not working in Spring MVC 3
- Spring Boot exception: Could not open ServletContext resource [/WEB-INF/dispatcherServlet-servlet.xml]
- Spring – Modifying headers for every request after processing (in postHandle)
- Angular 2 Spring Boot Login CORS Problems
- Delete or put methods in thymeleaf
- Does Spring @RequestBody support the GET method?
- Logging response body (HTML) from HttpServletResponse using Spring MVC HandlerInterceptorAdapter