Spring MVC访问静态资源的方法之一就是在Spring的配置文件里增加
<!-- 静态资源获取 -->
<mvc:resources location="/images/" mapping="/images/**"/>
在学习李志宏的Spring MVC视频的过程中,遇到了一个问题:在配置文件中添加以上语句图片也不能显示。问题出在了JSP页面代码上。以下为显示图片的JSP页面代码:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h>图片访问</h>
<div>
&l