Eclipse_设置JSP模板

  1. Windows->Perference->Web->JSP Files 设置编码
    在这里插入图片描述
  2. ->Editor->Templates 设置模板
    在这里插入图片描述
  3. 模板内容
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ 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>
<html>
<head>
<base href="<%=basePath %>" >
<meta charset="${encoding}">
<title>Insert title here</title>
</head>
<body>
${cursor}
</body>
</html>
发布了340 篇原创文章 · 获赞 23 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/Chill_Lyn/article/details/104106901
今日推荐