打开eclipse-->Window-->Preferences-->Web-->JSP Files-->Templates-->New JSP File(html)-->Edit...
1 <%@ page language="java" contentType="text/html; charset=UTF-8" 2 pageEncoding="UTF-8"%> 3 <% 4 String path = request.getContextPath(); 5 String basePath = request.getScheme() + "://" 6 + request.getServerName() + ":" + request.getServerPort() 7 + path + "/"; 8 %> 9 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">10 <html>11 <head>12 <base href="<%=basePath%>" />13 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">14 <title>Insert title here</title>15 </head>16 <body>17 18 </body>19 </html>
jsp上下文模板
原文地址:http://www.cnblogs.com/tyjt/p/7460250.html