此修改只是针对MyEclipse7.0以上的版本,对于7.0以下的修改,不太一样。网上有教程。
若要修改MyEclipse7.0以上JSP的模板,步骤如下:(我的是8.5的)
修改过程中,建议关掉MyEclipse
1.找到Genuitec\Common\plugins下的com.genuitec.eclipse.wizards_8.5.0.zmyeclipse75020090612.jar
(
- "Common"和"MyEclipse 8.5"同在"Genuitec"文件夹下
- 搜索:com.genuitec.eclipse.wizards,迅速定位到com.genuitec.eclipse.wizards_8.5.0.zmyeclipse75020090612.jar
- 以防万一,建议先备份那个.jar包
)
2.选择使用WinRAR打开
3.在WinRAR里,依次进入: templates --->jsp
4.最后打开Jsp-html.vtl 和 Jsp.vtl
5.按照自己喜欢的风格,对其进行修改
我将其修改如下:
#*---------------------------------------------#
# Template for a JSP as HTML
# @version: 1.2
# @author: Ferret Renaud
# @author: Jed Anderson
#---------------------------------------------#
*#<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.util.*" session="true"%>
<%@ page import="java.text.*" %>
<%--
<%@ taglib uri="/struts-tags" prefix="s"%>
--%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>set your title</title>
<!--
<link rel="stylesheet" type="text/css" href="CSS.css" />
<script language="JavaScript" type="text/javascript" src="jquery.js"></script>
-->
<script language="JavaScript" type="text/javascript" src="Macrotea-CommonHelper.js"></script>
<style type="text/css">
</style>
<script type="text/javascript">
</script>
</head>
<body>
</body>
</html>
7.如果你喜欢,也可以对html进行修改,使其方便自己。
#*---------------------------------------------#
# Template for an HTML file
# @version1.3
# @author Ferret Renaud
# @author Jed Anderson
#----------------------------------------------#
*#<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>set your title</title>
<!--
<link rel="stylesheet" type="text/css" href="CSS.css" />
<script language="JavaScript" type="text/javascript" src="jquery.js"></script>
-->
<script language="JavaScript" type="text/javascript" src="Macrotea-CommonHelper.js"></script>
<style type="text/css">
</style>
<script type="text/javascript">
</script>
</head>
<body>
</body>
</html>
Servlet模板:
#---------------------------------------------#
# <aw:description>Template for Servlet</aw:description>
# <aw:version>1.1</aw:version>
# <aw:date>04/05/2003</aw:date>
# <aw:author>Ferret Renaud</aw:author>
#---------------------------------------------#
<aw:import>java.io.IOException</aw:import>
<aw:import>java.io.PrintWriter</aw:import>
<aw:import>javax.servlet.ServletException</aw:import>
<aw:import>javax.servlet.http.HttpServlet</aw:import>
<aw:import>javax.servlet.http.HttpServletRequest</aw:import>
<aw:import>javax.servlet.http.HttpServletResponse</aw:import>
<aw:parentClass>javax.servlet.http.HttpServlet</aw:parentClass>
private HttpSession session;
private RequestDispatcher dispatcher;
<aw:constructor name="c1">
public <aw:className/>() {
super();
}
</aw:constructor>
<aw:method name="doGet">
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
/*Prepare*/
response.setContentType("text/html");
response.setCharacterEncoding("UTF-8");
session = request.getSession();
dispatcher=request.getRequestDispatcher("/servlet/login.do");
}
</aw:method>
<aw:method name="doPost">
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
</aw:method>
<aw:method name="doPut">
public void doPut(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
}
</aw:method>
<aw:method name="doDelete">
public void doDelete(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
}
</aw:method>
<aw:method name="init">
public void init() throws ServletException {
super.init();
}
</aw:method>
<aw:method name="destroy">
public void destroy() {
super.destroy();
session=null;
dispatcher=null;
}
</aw:method>
<aw:method name="getServletInfo">
public String getServletInfo() {
return "This is my default servlet created by Eclipse";
}
</aw:method>
8.最后WinRAR提示是否保存对jar包的修改,“是”就行了。
MyEclipse中默认的文档开头是:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
其对CSS的支持不太好,因此还是改成兼容性好点的,建议从DW中复制过来。
10.这下爽了。方便很多了。
分享到:
相关推荐
myeclipse7.5注册码 myeclipse7.5 myeclipse7.5myeclipse7.5myeclipse7.5myeclipse7.5myeclipse7.5myeclipse7.5myeclipse7.5myeclipse7.5myeclipse7.5
myeclipse7.5,能用到年呀。我注册了,真的,呵呵
使用MyEclipse7.5注册码可以注册MyEclipse7.5,使得在编程工程中使用MyEclipse7.5时不会老MyEclipse7.5缺少注册码的提示信息
MyEclipse7.5MyEclipse7.5
myeclipse 7.5 注册码, myeclipse 7.5的注册方式。
2009-6-18 JSP中文学习网独家发布 www.jsphelp.com 次汉化包是由 MyEclipse 7.1 汉化包修改 免费下载地址: http://download.jsphelp.com/data/MyEclipse 7.5正式版(09-6-17)汉化插件.rar 方法一(推荐!) 1.将...
MyEclipse7.5_优化 ,一个朋友的个人总结,对用 MyEclipse7.5的朋友提高自己的效率帮助应该会很大
MyEclipse7.5 注册码
MyEclipse7.5安装SVN (线下安装)
MyEclipse 7.5正式版汉化插件
MyEclipse 7.5 Keygen
MyEclipse7.5 注册 破解代码 使用方法: 运行-〉输入名-〉取得注册码。
本文简单有效的描述了如何在Myeclipse7.5下下载安装SVN插件的步骤。
MyEclipse7.5+EclipseMe+WTK2.5搭建J2ME开发环境
描述了Myeclipse7.5下怎样实现svn的插件安装详细步骤。
C:\\Program Files\\Genuitec\\MyEclipse 7.5\\language\\plugins 修改成你language所在的路径 替换main函数的原先的事例路径.注意粘贴后,要将你的路径的单个\全部改为\\或者/ 4.运行你的代码 5.将产生的结果,复制到...
MyEclipse 7.5 注册码MyEclipse 7.5 注册码MyEclipse 7.5 注册码
MyEclipse 7.5 正式版 中文插件安装指南