开发者

ServletContext and Spring MVC

开发者 https://www.devze.com 2023-02-28 06:57 出处:网络
How can I get the S开发者_开发问答ervletContext inside an Interceptor in Spring MVC 3?Since interceptor is a bean, you can simply autowire it:

How can I get the S开发者_开发问答ervletContext inside an Interceptor in Spring MVC 3?


Since interceptor is a bean, you can simply autowire it:

@Autowired
ServletContext context;


Please look at this example

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

and then request.getSession().getServletContext()

0

精彩评论

暂无评论...
验证码 换一张
取 消