开发者

ServletContext and Spring MVC

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜