public class ItemPathInterceptor extends HandlerInterceptorAdapter {


@Override
public boolean preHandle(HttpServletRequest request,
HttpServletResponse response, Object handler) throws Exception {

request.setAttribute("itemPath", request.getContextPath());

return true;
}
}

或者直接引用 request.getContextPath();

这里的itemPath和前一篇的 ${pageContext.request.contextPath} 是一样的结果,我们可以用${itemPath}

最新文章

  1. 【XLL 框架库函数】 TempActiveCell/TempActiveCell12
  2. 用STM32CubeMX创建FreeRTOS项目
  3. HDU3727 - Jewel(主席树)
  4. 关于Java(介绍)
  5. ArcGIS Server 9.3 安装(win7).
  6. Spring源码地址和相关介绍的网址
  7. DOCKER 从入门到放弃(一)
  8. 懒人小技巧, Toad 常用偷懒方法
  9. Android 开发 倒计时功能 转载
  10. Oracle远程登录命令
  11. python之路----面向对象进阶二
  12. Python实现代码行数统计工具
  13. UVA LIVE-3263 - That Nice Euler Circuit
  14. linux centos 系统怎么设置中文模式
  15. mysql的.sql文件头部 /*!32312 IF NOT EXISTS*/;
  16. winsock的io模型(终极篇)
  17. 叙Windows平台下基于MBR和UEFI的bootkit(一)--以MBR为例
  18. SecureCRT配置文件保存和导入
  19. SOAPUI 压力测试的指标项说明
  20. 小程序swiper配置参数使用

热门文章

  1. Mysql8.0导入数据时出错
  2. JS 实现兼容浏览器报警提示声音
  3. python-封装方法用于读取excel
  4. 前三次OO作业小结
  5. Comparator与Comparable,自定义排序和类比较器,TreeSet对象排序
  6. react基础学习 二——生命周期
  7. session的处理机制
  8. SpringCloud系列八:Zuul 路由访问(Zuul 的基本使用、Zuul 路由功能、zuul 过滤访问、Zuul 服务降级)
  9. Monkey测试简介
  10. Nginx与ftp服务器