您的位置:首页 > 编程语言 > Java开发

eclipse新建jsp页面默认模板设置

2014-05-07 16:52 351 查看
设置步骤如下: eclipse -- >perferences - >web ->jsp - jsp files -Editor ->templates 在这里可以设置模板








代码:

<%@ 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%>">        

  <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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: