天天看點

eclipse建立jsp頁面預設模闆設定

設定步驟如下: eclipse -- >perferences - >web ->jsp - jsp files -Editor ->templates 在這裡可以設定模闆

eclipse建立jsp頁面預設模闆設定
eclipse建立jsp頁面預設模闆設定

代碼:

<%@ page language="java" contentType="text/html; charset=${encoding}" pageEncoding="${encoding}"%>

<%

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%>" target="_blank" rel="external nofollow" >        

  <meta http-equiv="pragma" content="no-cache">

  <meta http-equiv="cache-control" content="no-cache">

  <meta http-equiv="expires" content="-1">   

  <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">

  <meta http-equiv="description" content="This is my page">

  <meta http-equiv="Content-Type" content="text/html; charset=${encoding}">

  <title>Insert title here</title>

</head>

<body>

${cursor}

</body>

</html>

繼續閱讀