SpringMVC maven-tomcat7插件静态资源图片处理

引言,在springMVC 项目中存在两个web项目,一个前台展示系统,一个后台管理系统,前台展示需要用到后台上传的图片,为了能让前台使用,那么就需要给前台tomcat插件配置静态资源图片路径处理

如图:

 <plugin>
      <groupId>org.apache.tomcat.maven</groupId>
      <artifactId>tomcat7-maven-plugin</artifactId>
      <configuration>
          <path>/</path>
          <port>9001</port>
          <staticContextPath>/img</staticContextPath>
          <staticContextDocbase>C:/Users/sinodata-ylq/IdeaProjects/zshop/zshop_parent/zshop_backend_web/src/main/webapp/WEB-INF/upload/</staticContextDocbase>
           <contextReloadable>false</contextReloadable>
           <useTestClasspath>true</useTestClasspath>
        </configuration>
 </plugin>

如果你仅仅配置还是不可以的需要下载改造后的tomcat7的插件包,

maventomcat7改造后插件-Java文档类资源-CSDN下载

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值