在Eclipse菜单栏选择Window -> properties -> Web -> JSP files -> Editor -> Templates
选择右上方的 NEW 选项如下:
选择命名后,在Pattern框填写模板内容,如果是Java Web 项目,可以参考下列内容:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<h:title>
Insert title here
</h:title>
</h:head>
<h:body>
${date}
</h:body>
</html>