引用 http://iscode.iteye.com/blog/628548 的方法
1.关掉myeclipse9.
2.在myeclipse9的安装目录下面找到
D:\Program Files\MyEclipse 9.0\Common\plugins\com.genuitec.eclipse.wizards_9.0.0.me201103012021.jar
其中:9.0.0是版本号, 201103012021可能是编译时间或者打包时间 你的这两个值可能不一样 但是其他都会一样。
3.然后用rar或者解压缩软件打开,进入templates\jsp面,看到很多模板。
4.随便复制一个模板出来,只要哪个模板,你看你自己的需要吧。
5.修改你复制出来的模板。比如我修改成
struts2_jsp.vtl
1 2 3 4 5 6 7 8 9 10 |
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> <%@ page contentType=" text/html; charset=UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags"%> <html> <head> <title>Hello World</title> </head> <body> <h3>Hello World</h3> </body> </html> |
然后保存,并添加到com.genuitec.eclipse.wizards_9.0.0.me201103012021.jar包里面去。
4.回到根的地方,看见templates.xml
增加一个元素如下:
1 2 3 4 |
<template context="com.genuitec.eclipse.wizards.jsp" script="templates/jsp/struts2_jsp.vtl" name="struts2_jsp"/> |
templates/jsp/struts2_jsp.vtl是模板名字
struts2_jsp是新建jsp那里的名字
context=”com.genuitec.eclipse.wizards.jsp” 这个一定要存在,并且跟其他jsp模板的设置一样,复制就可以。
5.然后保存jar文件。重新打开myeclipse9,点new/jsp 看看 是否多出了一个struts2_jsp的模板。
恭喜你,成功……………………