第一步:找到JSP模板
eclipse -- >perferences - >Web -> jsp files -Editor ->templates:

第二步:准備編輯JSP的模板
選擇JSP with html markup,點擊右邊的Edit進入編輯界面

第三步:把編輯好的模板內容粘貼進去
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <% 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> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> <style type="text/css"> </style> </head> <body> </body> <script type="text/javascript"> </script> </html>

點擊 Apply and Close
