1、图片文件路径,注意图片文件夹和WEB-INFO文件夹同级

    springmvc+jsp引用本地图片文件

  2、web.xml配置

  

 <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.png</url-pattern>
  </servlet-mapping>

  3、spring-web.xml配置

<mvc:resources location="/image/" mapping="/image/**" />

  4、jsp引用

  

<style type="text/css">
            body 
            {
                background-image:url('${pageContext.request.contextPath}/image/bimag1.png');
                background-color:#cccccc;
            }
        </style>

 

相关文章:

  • 2021-07-02
  • 2022-12-23
  • 2021-05-17
  • 2021-11-24
  • 2022-03-02
  • 2022-12-23
  • 2021-05-31
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-23
  • 2021-08-22
  • 2021-12-24
  • 2021-07-19
  • 2022-12-23
  • 2021-12-23
相关资源
相似解决方案