eclipse 修改jsp templates
Eclipse 默认 创建的JSP页面没有 相对路径
打开Eclipse
Window-->>Preferences-->>Web-->>JSP Files-->>Editor-->>Templates
<%@ 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" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <base href="<%=basePath%>"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title></title> </head> <body> </body> </html>