FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaEE/GenericServlet_Hello.java at master · goder/JavaEE · GitHub
goder
JavaEE
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaEE
/
GenericServlet_Hello.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
33 lines (25 loc) · 859 Bytes
Breadcrumbs
JavaEE
/
GenericServlet_Hello.java
Copy path
File metadata and controls
33 lines (25 loc) · 859 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
/*
* Servlet实现之第二种方式实现GenericServlet接口
*/
package
com
.
bj
.
servlet
;
import
java
.
io
.
IOException
;
import
java
.
io
.
PrintWriter
;
import
javax
.
servlet
.
GenericServlet
;
import
javax
.
servlet
.
ServletException
;
import
javax
.
servlet
.
ServletRequest
;
import
javax
.
servlet
.
ServletResponse
;
public
class
GenericServlet_Hello
extends
GenericServlet
{
@
Override
public
void
service
(
ServletRequest
request
,
ServletResponse
response
)
throws
ServletException
,
IOException
{
// TODO Auto-generated method stub
System
.
out
.
println
(
"service it"
);
//返回Hello,World! generic
try
{
//param1中得到PrintWriter
PrintWriter
pw
=
response
.
getWriter
();
pw
.
println
(
"Hello,World! genericServlet"
);
}
catch
(
Exception
ex
){
ex
.
printStackTrace
();
}
}
}
Back
|
FazBrowse Home
|
New Git URL