方法一
<%
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
%>
<head>
<base href="<%=basePath%>">
<script type="text/javascript" src="js/*.js"></script>
</head>
<img src="<%=basePath>/image/1.png">
方法二
<img src="${pageContext.request.contextPath}/images/logo.jpg"></a>
或者
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>测试SSM框架整合</title>
<base href="${pageContext.request.scheme }://${pageContext.request.serverName }:${pageContext.request.serverPort }${pageContext.request.contextPath }/ "/>
</head>
<body>
<a href="test/ssm.html">测试ssm整合</a>
</body>
</html>