jsp相对路径无法显示图片
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<br>
<div style="background:black;width: 70%;height:7%;margin-left: 17%;margin-top:-1%;color: white;font-size:2em" boder="1">
<tr><td><a href="Register.jsp" style="text-decoration: none;color: white;">注 册</a></td></tr>
</div>
</div>
把img放到WebRoot底下去
img文件的位置不对
img放在webroot下面。直接用img/0.jpg就可以了