Vir*_*gam 46 servlets spring-mvc
如何在Spring MVC 3中的Interceptor中获取ServletContext?
axt*_*avt 110
由于拦截器是一个bean,你可以简单地自动装配它:
@Autowired
ServletContext context;
Run Code Online (Sandbox Code Playgroud)
请看这个例子
http://www.vaannila.com/spring/spring-interceptor.html
然后是request.getSession().getServletContext()
| 归档时间: |
|
| 查看次数: |
50140 次 |
| 最近记录: |