尝试将以下资源声明添加到您的Spring配置中:
<!-- Handles HTTP GET requests for /images/** by efficiently serving up static resources in the ${webappRoot}/images directory --><resources mapping="/images/**" location="/images/" />另外,更常见的是,有一个
resources包含所有资源(图像,css,js等)的文件夹,该文件夹按子目录划分。
您的配置将如下所示:
<!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory --><resources mapping="/resources/**" location="/resources/" />您的资源将被引用如下:
<link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/screen.css" />" /><script type="text/javascript" src="<c:url value="/resources/js/jquery-1.6.4.min.js" />"></script><img src="<c:url value="/resources/images/left_arrow.png" />" alt="" />



