Java代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
#---------------------------------------------#
# <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>
<aw:constructor name=
"c1"
>
/**
* Constructor of the object.
*/
public
<aw:className/>() {
super
();
}
</aw:constructor>
<aw:method name=
"doGet"
>
public
void
doGet(HttpServletRequest request, HttpServletResponse response)
throws
ServletException, IOException {
}
</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 {
// Put your code here
}
</aw:method>
<aw:method name=
"doDelete"
>
public
void
doDelete(HttpServletRequest request, HttpServletResponse response)
throws
ServletException, IOException {
// Put your code here
}
</aw:method>
<aw:method name=
"init"
>
public
void
init()
throws
ServletException {
// Put your code here
}
</aw:method>
<aw:method name=
"destroy"
>
/**
* Destruction of the servlet. <br>
*/
public
void
destroy() {
super
.destroy();
// Just puts "destroy" string in log
// Put your code here
}
</aw:method>
<aw:method name=
"getServletInfo"
>
public
String getServletInfo() {
return
"This is my default servlet created by Eclipse"
;
}
</aw:method>
|
描述:找到这个路径下的MyEclipse\Common\plugins的com.genuitec.eclipse.wizards_9.0.0.me201108091322.jar,我用的是myeclipse10,用解压缩软件打开,并修改添加进去既可,templates文件夹里全部是模板代码,你可以任意疯狂了,修改里面的废物代码,利用搜索servlet.java就是你要修改的