ServletContext and Spring MVC

How can I get a ServletContext inside an Interceptor in Spring MVC 3?

+44
spring-mvc servlets
Apr 21 '11 at 4:25
source share
2 answers

Since the interceptor is a bean, you can simply auto-verify it:

@Autowired ServletContext context; 
+107
Apr 21 2018-11-21T00
source share

Look at this example

http://www.vaannila.com/spring/spring-interceptor.html

and then request.getSession (). getServletContext ()

+6
Apr 21 '11 at 5:23
source share



All Articles