您的位置:首页 > 编程语言 > Java开发

The Java EE 6 Tutorial

2015-08-29 08:45 417 查看

What Is a Servlet?

A servlet is a Java programming language class used to extend the capabilities of servers that host applications accessed by means of a request-response programming model. Although servlets can respond to any type of request, they are commonly used to extend the applications hosted by web servers. For such applications, Java Servlet technology defines HTTP-specific servlet classes.

The
javax.servlet
and
javax.servlet.http
packages provide interfaces and classes for writing servlets. All servlets must implement the
Servlet
interface, which defines lifecycle methods. When implementing a generic service, you can use or extend the
GenericServlet
class provided with the Java Servlet API. The
HttpServlet
class provides methods, such as
doGet
and
doPost
, for handling HTTP-specific services.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: