myEclipse使用自定义模板

No.1:

关闭MyEclipse,找到文件MyEclipse\Common\plugins\com.genuitec.eclipse.wizards_9.0.0.me201108091322.jar(注意不同的版本,这个文件后面的数字不一样,不要惊慌),备份之。

No.2:

创建文件Custom.vtl,在里面编辑自己定义的Jsp代码模板,例如:

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>Custom JSP '$title' starting page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="styles.css">
	<link rel="SHORTCUT ICON" href="ico.ico">
  </head>
  <body>
    This is my JSP page. <br>
  </body>
</html>
保存之。。

No.3:

使用winrar软件打开第一步的jar包,并切换至com.genuitec.eclipse.wizards_9.0.0.me201108091322.jar\templates\jsp目录,如图:

No.4:

将第二步创建的Custom.vtl文件拖放至第三步图中的目录下,确认将其压缩至com.genuitec.eclipse.wizards_9.0.0.me201108091322.jar包中

No.5:

打开包com.genuitec.eclipse.wizards_9.0.0.me201108091322.jar中的templates.xml文件,在<templateLibrary>标签内添加如下代码:

<template
	context="com.genuitec.eclipse.wizards.jsp"
	script="templates/jsp/Custom.vtl"
	name="Custom Jsp template"/>  

其中的name属性的值是可以自定义的哦,然后保存,确保这个被修改后的templates.xml放置在com.genuitec.eclipse.wizards_9.0.0.me201108091322.jar包中相应的位置上。

No.6:启动MyEclipse,创建一个新的Jsp,测试一下效果吧,如果一切顺利,效果如下图所示:



No.7:结束了,大功告成喽。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值