- 浏览: 16618103 次
- 性别:
- 来自: 济南
最新评论
-
wu1236:
ef0793cd94337324b6fefc4c9474af5 ...
Android ApiDemos示例解析(87):Media->MediaPlayer -
77219634:
0127bf2236bee4dd1f632ce430f1af1 ...
本博客文章都为转载,没有任何版权! -
77219634:
0127bf2236bee4dd1f632ce430f1af1 ...
VPLEX - EMC的RAC -
77219634:
0127bf2236bee4dd1f632ce430f1af1 ...
qTip2 Show -
77219634:
0127bf2236bee4dd1f632ce430f1af1 ...
SecureCRT中文乱码、复制粘贴乱码解决办法(修改版)
javax.servlet.http.HttpServlet翻译
<!-- -->
|
JavaTM 2 Platform Ent. Ed. v1.4 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> All Classes <noscript></noscript> | |||||||
SUMMARY:NESTED|FIELD|CONSTR|METHOD | DETAIL:FIELD|CONSTR|METHOD |
<!-- ======== START OF CLASS DATA ======== -->
javax.servlet.http
Class HttpServlet
java.lang.Object javax.servlet.GenericServlet javax.servlet.http.HttpServlet
Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A subclass of HttpServlet
must override at least one method, usually one of these: 提供一个抽象类使子类可以创建一个适合Web站点的HTTP servlet。HttpServlet的子类至少应该覆盖下面列出的方法中的一个:
doGet
, if the servlet supports HTTP GET requests servlet支持HTTP GET请求doPost
, for HTTP POST requests 支持HTTP POST请求doPut
, for HTTP PUT requests 支持HTTP PUT请求doDelete
, for HTTP DELETE requests 支持HTTP DELETE请求init
anddestroy
, to manage resources that are held for the life of the servlet 管理servlet生命周期中保持的资源getServletInfo
, which the servlet uses to provide information about itself servlet用来提供自身的信息
There's almost no reason to override the service
method. service
handles standard HTTP requests by dispatching them to the handler methods for each HTTP request type (the do
XXX methods listed above). 没有理由需要重写service方法。service处理标准HTTP请求,将每种HTTP请求类型转发至不同的处理方法(上面列出的doXXXmethods)
Likewise, there's almost no reason to override the doOptions
and doTrace
methods. 同样,也没有理由重写doOptions和doTrace方法。
Servlets typically run on multithreaded servers, so be aware that a servlet must handle concurrent requests and be careful to synchronize access to shared resources. Shared resources include in-memory data such as instance or class variables and external objects such as files, database connections, and network connections. See the Java Tutorial on Multithreaded Programming for more information on handling multiple threads in a Java program. servlet通常运行在多线程的服务器上,因此servlet必须处理并发请求,小心地同步化访问共享资源。 共享资源包括内存中的数据比如实例或类变量和外部对象比如文件、数据库连接以及网络连接。 关于Java程序中处理多线程的更多详情参见Java Tutorial on Multithreaded Programming。
<!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><!-- -->
Constructor Summary |
HttpServlet() Does nothing, because this is an abstract class. 不做任何事,因为这是一个抽象类。 |
Method Summary | |
protected void |
doDelete(HttpServletRequestreq, HttpServletResponseresp) Called by the server (via the service method) to allow a servlet to handle a DELETE request. 由服务器service方法通过调用来允许servlet处理DELETE请求。
|
protected void |
doGet(HttpServletRequestreq, HttpServletResponseresp) Called by the server (via the service method) to allow a servlet to handle a GET request. 由服务器service方法通过调用来允许servlet处理GET请求。
|
protected void |
doHead(HttpServletRequestreq, HttpServletResponseresp) Receives an HTTP HEAD request from the protected service method and handles the request. 从受保护的service方法接收HTTP HEAD请求,并且处理该请求。
|
protected void |
doOptions(HttpServletRequestreq, HttpServletResponseresp) Called by the server (via the service method) to allow a servlet to handle a OPTIONS request. 由服务器service方法通过调用来允许servlet处理OPTIONS请求。
|
protected void |
doPost(HttpServletRequestreq, HttpServletResponseresp) Called by the server (via the service method) to allow a servlet to handle a POST request. 由服务器service方法通过调用来允许servlet处理POST请求。
|
protected void |
doPut(HttpServletRequestreq, HttpServletResponseresp) Called by the server (via the service method) to allow a servlet to handle a PUT request. 由服务器service方法通过调用来允许servlet处理PUT请求。
|
protected void |
doTrace(HttpServletRequestreq, HttpServletResponseresp) Called by the server (via the service method) to allow a servlet to handle a TRACE request. 由服务器service方法通过调用来允许servlet处理TRACE请求。
|
protected long |
getLastModified(HttpServletRequestreq) Returns the time the HttpServletRequest object was last modified, in milliseconds since midnight January 1, 1970 GMT. 返回HttpServletRequest对象上次修改的时间,记为从GMT1970年1月1日零时以来的毫秒数。
|
protected void |
service(HttpServletRequestreq, HttpServletResponseresp) Receives standard HTTP requests from the public service method and dispatches them to the do XXX methods defined in this class. 从公开的service方法接收标准HTTP请求,转发至类中定义的doXXX方法。
|
void |
service(ServletRequestreq, ServletResponseres) Dispatches client requests to the protected service method. 转发客户端请求至受保护的service方法。
|
Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
<!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- -->
Constructor Detail |
HttpServlet
public HttpServlet()
Method Detail |
doGet
protected void doGet(HttpServletRequestreq, HttpServletResponseresp) throws ServletException, IOException
service
method) to allow a servlet to handle a GET request. 由服务器service方法通过调用来允许servlet处理GET请求。 Overriding this method to support a GET request also automatically supports an HTTP HEAD request. A HEAD request is a GET request that returns no body in the response, only the request header fields. 重写方法支持GET请求也会自动支持HTTP HEAD请求。HEAD请求是一个不返回响应体的GET请求,只包含请求头字段。
When overriding this method, read the request data, write the response headers, get the response's writer or output stream object, and finally, write the response data. It's best to include content type and encoding. When using a PrintWriter
object to return the response, set the content type before accessing the PrintWriter
object. 当重写该方法时,读取请求数据,写入请求头,获取请求writer或者输出流对象,最后,写响应数据。最好包括内容类型和编码。当使用PrintWriter对象返回响应时,在方法PrintWriter对象之前设置内容类型。
The servlet container must write the headers before committing the response, because in HTTP the headers must be sent before the response body. servlet容器必须在提交响应前写入头,因为HTTP中在响应体前必须发送头。
Where possible, set the Content-Length header (with the ServletResponse.setContentLength(int)
method), to allow the servlet container to use a persistent connection to return its response to the client, improving performance. The content length is automatically set if the entire response fits inside the response buffer. 有可能的话,应通过ServletResponse.setContentLength(int)方法设置Content-Length头,以允许servlet容器使用持久化的连接来返回对客户端的响应,这样可以改善性能。如果整个响应匹配请求缓存会自动设置内容长度。
When using HTTP 1.1 chunked encoding (which means that the response has a Transfer-Encoding header), do not set the Content-Length header. 当使用HTTP 1.1编码(意味着响应有一个编码转换头)时,不用设置Content-Length头。
The GET method should be safe, that is, without any side effects for which users are held responsible. For example, most form queries have no side effects. If a client request is intended to change stored data, the request should use some other HTTP method. GET方法应当是安全的,也就是对于负责的用户不会有边界效应。比如,大多数的查询没有边界效应。如果客户端请求想要修改保存的数据,请求应该使用其他的HTTP方法。
The GET method should also be idempotent, meaning that it can be safely repeated. Sometimes making a method safe also makes it idempotent. For example, repeating queries is both safe and idempotent, but buying a product online or modifying data is neither safe nor idempotent. GET方法应该是等幂的,意味着它可以安全地重复。有时使一个方法安全也就是使它等幂。比如。重复查询既是安全也是等幂的,但是在线购买商品或者修改数据则既不安全也不等幂。
If the request is incorrectly formatted, doGet
returns an HTTP "Bad Request" message. 如果该请求格式不正确,doGet返回一个HTTP“错误请求”信息。
req
- an HttpServletRequest
object that contains the request the client has made of the servlet HttpServletResponse对象,包含客户端向servlet发出的请求
resp
- an HttpServletResponse
object that contains the response the servlet sends to the client HttpServletResponse对象,包含servlet向客户端返回的响应
IOException
- if an input or output error is detected when the servlet handles the GET request 如果servlet处理GET请求时侦测到输入输出错误时抛出
ServletException
- if the request for the GET could not be handled 如果GET请求不能被处理则抛出
ServletResponse.setContentType(java.lang.String)
<!-- -->
getLastModified
protected long getLastModified(HttpServletRequestreq)
HttpServletRequest
object was last modified, in milliseconds since midnight January 1, 1970 GMT. If the time is unknown, this method returns a negative number (the default). 返回HttpServletRequest对象上次修改的时间,记为从GMT1970年1月1日零时以来的毫秒数。 Servlets that support HTTP GET requests and can quickly determine their last modification time should override this method. This makes browser and proxy caches work more effectively, reducing the load on server and network resources. 应该重写该方法使servlet支持HTTP GET请求,可以迅速确定上次修改时间。 这使浏览器和代理cache工作更有效,减少服务器和网络资源的加载。
req
- the HttpServletRequest
object that is sent to the servlet 发送给servlet的HttpServletRequest对象 long
integer specifying the time the HttpServletRequest
object was last modified, in milliseconds since midnight, January 1, 1970 GMT, or -1 if the time is not known 一个long型整数,指定HttpServletRequest对象上次修改的时间, 记为从GMT1970年1月1日零时以来的毫秒数,如果未知返回-1。<!-- -->
doHead
protected void doHead(HttpServletRequestreq, HttpServletResponseresp) throws ServletException, IOException
Receives an HTTP HEAD request from the protected service
method and handles the request. The client sends a HEAD request when it wants to see only the headers of a response, such as Content-Type or Content-Length. The HTTP HEAD method counts the output bytes in the response to set the Content-Length header accurately. 从受保护的service方法接收HTTP HEAD请求,并且处理该请求。 当客户端想查看请求头,比如 Content-Type和Content-Length时,发动一个HEAD请求。HTTP HEAD方法统计响应中的输出字节大小,来精确设置Content-Length头。
If you override this method, you can avoid computing the response body and just set the response headers directly to improve performance. Make sure that the doHead
method you write is both safe and idempotent (that is, protects itself from being called multiple times for one HTTP HEAD request). 如果你重写了该方法,你可以避免计算请求体,直接设置请求头以提高性能。确保你写的doHead方法是安全和等幂的(也就是说,保证自己不被一个HTTP HEAD请求多次调用。)
If the HTTP HEAD request is incorrectly formatted, doHead
returns an HTTP "Bad Request" message. 如果HTTP HEAD请求格式不正确,doHead返回一个HTTP“错误请求”信息。
req
- the request object that is passed to the servlet HttpServletResponse对象,包含客户端向servlet发出的请求 resp
- the response object that the servlet uses to return the headers to the client HttpServletResponse对象,包含servlet向客户端返回的响应 IOException
- if an input or output error occurs 如果发生输入输出错误时抛出
ServletException
- if the request for the HEAD could not be handled 如果HEAD请求不能被处理则抛出
<!-- -->
doPost
protected void doPost(HttpServletRequestreq, HttpServletResponseresp) throws ServletException, IOException
service
method) to allow a servlet to handle a POST request. The HTTP POST method allows the client to send data of unlimited length to the Web server a single time and is useful when posting information such as credit card numbers. 由服务器service方法通过调用来允许servlet处理POST请求。 HTTP POST方法允许客户端向Web服务器一次发送无限长度的数据,对于提交比如信用卡号码信息是有用的。 When overriding this method, read the request data, write the response headers, get the response's writer or output stream object, and finally, write the response data. It's best to include content type and encoding. When using a PrintWriter
object to return the response, set the content type before accessing the PrintWriter
object. 当重写该方法时,读取请求数据,写入请求头,获取请求writer或者输出流对象,最后,写响应数据。最好包括内容类型和编码。当使用PrintWriter对象返回响应时,在方法PrintWriter对象之前设置内容类型。
The servlet container must write the headers before committing the response, because in HTTP the headers must be sent before the response body. servlet容器必须在提交响应前写入头,因为HTTP中在响应体前必须发送头。
Where possible, set the Content-Length header (with the ServletResponse.setContentLength(int)
method), to allow the servlet container to use a persistent connection to return its response to the client, improving performance. The content length is automatically set if the entire response fits inside the response buffer. 有可能的话,应通过ServletResponse.setContentLength(int)方法设置Content-Length头,以允许servlet容器使用持久化的连接来返回对客户端的响应,这样可以改善性能。如果整个响应匹配请求缓存会自动设置内容长度。
When using HTTP 1.1 chunked encoding (which means that the response has a Transfer-Encoding header), do not set the Content-Length header. 当使用HTTP 1.1编码(意味着响应有一个编码转换头)时,不用设置Content-Length头。
This method does not need to be either safe or idempotent. Operations requested through POST can have side effects for which the user can be held accountable, for example, updating stored data or buying items online. 该方法不需要安全和等幂。通过POST的请求操作对于保持账号的用户有副作用,比如更新保存的数据或在线购物。
If the HTTP POST request is incorrectly formatted, doPost
returns an HTTP "Bad Request" message. 如果HTTP POST请求格式不正确,doPost返回一个HTTP“错误请求”信息。
req
- an HttpServletRequest
object that contains the request the client has made of the servlet HttpServletResponse对象,包含客户端向servlet发出的请求
resp
- an HttpServletResponse
object that contains the response the servlet sends to the client HttpServletResponse对象,包含servlet向客户端返回的响应
IOException
- if an input or output error is detected when the servlet handles the request 如果servlet处理该请求时侦测到输入输出错误时抛出
ServletException
- if the request for the POST could not be handled 如果POST请求不能被处理则抛出
ServletOutputStream
, ServletResponse.setContentType(java.lang.String)
<!-- -->
doPut
protected void doPut(HttpServletRequestreq, HttpServletResponseresp) throws ServletException, IOException
service
method) to allow a servlet to handle a PUT request. The PUT operation allows a client to place a file on the server and is similar to sending a file by FTP. 由服务器service方法通过调用来允许servlet处理PUT请求。 PUT操作允许客户端向服务器放置文件,类似地通过FTP发送文件。 When overriding this method, leave intact any content headers sent with the request (including Content-Length, Content-Type, Content-Transfer-Encoding, Content-Encoding, Content-Base, Content-Language, Content-Location, Content-MD5, and Content-Range). If your method cannot handle a content header, it must issue an error message (HTTP 501 - Not Implemented) and discard the request. For more information on HTTP 1.1, see RFC 2616 . 当重写该方法时,保留完整的发送请求的任何内容头(包括 Content-Length、Content-Type、 Content-Transfer-Encoding、Content-Encoding、Content-Base、Content-Language、Content-Location、 Content-MD5和Content-Range)。如果你的方法不能处理内容头,必须发布错误信息(HTTP 501 - Not Implemented), 丢弃该请求。关于HTTP 1.1得更多详情,参见RFC 2616。
This method does not need to be either safe or idempotent. Operations that doPut
performs can have side effects for which the user can be held accountable. When using this method, it may be useful to save a copy of the affected URL in temporary storage. 该方法不需要安全和等幂。doPut执行的操作对于保持账号的用户有副作用。因此使用该方法时,临时保存一份受影响的URL的拷贝是有用的。
If the HTTP PUT request is incorrectly formatted, doPut
returns an HTTP "Bad Request" message. 如果HTTP PUT请求格式不正确,doPut返回一个HTTP“错误请求”信息。
req
- the HttpServletRequest
object that contains the request the client made of the servlet HttpServletResponse对象,包含客户端向servlet发出的请求
resp
- the HttpServletResponse
object that contains the response the servlet returns to the client HttpServletResponse对象,包含servlet向客户端返回的响应
IOException
- if an input or output error occurs while the servlet is handling the PUT request 如果servlet处理该请求时发生输入输出错误时抛出
ServletException
- if the request for the PUT cannot be handled 如果PUT请求不能被处理则抛出
<!-- -->
doDelete
protected void doDelete(HttpServletRequestreq, HttpServletResponseresp) throws ServletException, IOException
service
method) to allow a servlet to handle a DELETE request. The DELETE operation allows a client to remove a document or Web page from the server. 由服务器service方法通过调用来允许servlet处理DELETE请求。 DELETE操作允许客户端删除服务器上的文档或Web页面。 This method does not need to be either safe or idempotent. Operations requested through DELETE can have side effects for which users can be held accountable. When using this method, it may be useful to save a copy of the affected URL in temporary storage. 该方法不需要安全或者等幂。通过DELETE的请求操作对于保持账号的用户有副作用。因此使用该方法时,临时保存一份受影响的URL的拷贝是有用的。
If the HTTP DELETE request is incorrectly formatted, doDelete
returns an HTTP "Bad Request" message. 如果HTTP DELETE请求格式不正确,doDelete返回一个HTTP“错误请求”信息。
req
- the HttpServletRequest
object that contains the request the client made of the servlet HttpServletResponse对象,包含客户端向servlet发出的请求
resp
- the HttpServletResponse
object that contains the response the servlet returns to the client HttpServletResponse对象,包含servlet向客户端返回的响应
IOException
- if an input or output error occurs while the servlet is handling the DELETE request 如果servlet处理DELETE请求时发生输入输出错误时抛出
ServletException
- if the request for the DELETE cannot be handled 如果DELETE请求不能被处理则抛出
<!-- -->
doOptions
protected void doOptions(HttpServletRequestreq, HttpServletResponseresp) throws ServletException, IOException
service
method) to allow a servlet to handle a OPTIONS request. The OPTIONS request determines which HTTP methods the server supports and returns an appropriate header. For example, if a servlet overrides doGet
, this method returns the following header: 由服务器service方法通过调用来允许servlet处理OPTIONS请求。 OPTIONS请求确定服务器支持哪一个HTTP方法,返回一个合适的头。例如,如果servlet重写doGet,方法按以下形式返回头: Allow: GET, HEAD, TRACE, OPTIONS
There's no need to override this method unless the servlet implements new HTTP methods, beyond those implemented by HTTP 1.1. 不需要重写该方法除非servlet实现了新的HTTP方法,超出了HTTP 1.1的实现。
req
- the HttpServletRequest
object that contains the request the client made of the servlet HttpServletResponse对象,包含客户端向servlet发出的请求
resp
- the HttpServletResponse
object that contains the response the servlet returns to the client HttpServletResponse对象,包含servlet向客户端返回的响应
IOException
- if an input or output error occurs while the servlet is handling the OPTIONS request 如果servlet处理OPTIONS请求时发生输入输出错误时抛出
ServletException
- if the request for the OPTIONS cannot be handled 如果OPTIONS请求不能被处理则抛出
<!-- -->
doTrace
protected void doTrace(HttpServletRequestreq, HttpServletResponseresp) throws ServletException, IOException
service
method) to allow a servlet to handle a TRACE request. A TRACE returns the headers sent with the TRACE request to the client, so that they can be used in debugging. There's no need to override this method. 由服务器service方法通过调用来允许servlet处理TRACE请求。 TRACE返回发送给客户端的TRACE请求头,因此它们可以用来调试。 不需要重写该方法。
req
- the HttpServletRequest
object that contains the request the client made of the servlet HttpServletResponse对象,包含客户端向servlet发出的请求
resp
- the HttpServletResponse
object that contains the response the servlet returns to the client HttpServletResponse对象,包含servlet向客户端返回的响应
IOException
- if an input or output error occurs while the servlet is handling the TRACE request 如果servlet处理TRACE请求时发生输入输出错误时抛出
ServletException
- if the request for the TRACE cannot be handled 如果TRACE请求不能被处理则抛出
<!-- -->
service
protected void service(HttpServletRequestreq, HttpServletResponseresp) throws ServletException, IOException
service
method and dispatches them to the do
XXX methods defined in this class. This method is an HTTP-specific version of the Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
method. There's no need to override this method. 从公开的service方法接收标准HTTP请求,转发至类中定义的doXXX方法。该方法是Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)方法对于不同HTTP版本的具体实现。不需要重写该方法。
req
- the HttpServletRequest
object that contains the request the client made of the servlet HttpServletResponse对象,包含客户端向servlet发出的请求
resp
- the HttpServletResponse
object that contains the response the servlet returns to the client HttpServletResponse对象,包含servlet向客户端返回的响应
IOException
- if an input or output error occurs while the servlet is handling the HTTP request 如果servlet处理HTTP请求时发生输入输出错误时抛出
ServletException
- if the HTTP request cannot be handled 如果HTTP请求不能被处理则抛出
Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
<!-- -->
service
public void service(ServletRequestreq, ServletResponseres) throws ServletException, IOException
service
method. There's no need to override this method. 转发客户端请求至受保护的service方法。不需要重写该方法。
service
in interface Servlet
service
in class GenericServlet
req
- the HttpServletRequest
object that contains the request the client made of the servlet HttpServletResponse对象,包含客户端向servlet发出的请求
res
- the HttpServletResponse
object that contains the response the servlet returns to the client HttpServletResponse对象,包含servlet向客户端返回的响应
IOException
- if an input or output error occurs while the servlet is handling the HTTP request 如果servlet处理HTTP请求时发生输入输出错误时抛出
ServletException
- if the HTTP request cannot be handled 如果HTTP请求不能被处理则抛出
Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
<!-- ======= START OF BOTTOM NAVBAR ====== --><!-- -->
<!-- -->
|
JavaTM 2 Platform Ent. Ed. v1.4 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> All Classes <noscript></noscript> | |||||||
SUMMARY:NESTED|FIELD|CONSTR|METHOD | DETAIL:FIELD|CONSTR|METHOD |
Submit a bug or feature
Copyright 2003 Sun Microsystems, Inc. All rights reserved.
相关推荐
在Java Web开发中,`javax.servlet`包是核心的API之一,它提供了处理HTTP请求和响应的标准接口。这个jar包是Java Servlet规范的一部分,用于构建动态、交互式的Web应用程序。当你遇到“找不到javax.servlet.*”这样...
javax.servlet.http.HttpServlet.class javax.servlet.http.HttpServletRequest.class javax.servlet.http.HttpServletResponse.class javax.servlet.http.NoBodyResponse.class javax.servlet....
javax.servlet JAR包,解决找不到 import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; jar包问题
在Java编程环境中,`javax.servlet.jar` 是一个非常重要的库,它包含了Servlet和JSP(JavaServer Pages)的核心API,是开发Web应用程序的基础组件。这个包由Java EE(Enterprise Edition)标准提供,允许开发者创建...
在Java Web开发中,`javax.servlet.jar`和`javax.servlet.jsp.jar`是两个非常重要的库文件,它们分别提供了Servlet和JSP(JavaServer Pages)的核心API。这两个库是开发基于Java的Web应用程序不可或缺的部分,特别是...
【标题】"javax.servlet.jar与javax.servlet.jsp.jar"是Java Web开发中不可或缺的库文件,它们主要用于处理HTTP请求和构建动态网页。 【描述】在EJB(Enterprise JavaBeans)环境中,虽然提供了大量的服务来支持...
它包含了一些基本的Servlet和Filter接口,如`Servlet`, `GenericServlet`, `HttpServlet`, `Filter`, `ServletConfig`等。虽然3.1版本提供了更多高级功能,但2.5版本仍被许多老项目和不支持新规范的服务器使用。 3....
javax.servlet的jar包是Java Web开发中不可或缺的一部分,它提供了Servlet和JSP(JavaServer Pages)的核心API,使得开发者能够创建动态web应用程序。这个jar包是Java Servlet规范的一部分,由Java Community ...
2个方法 简单有图 傻瓜式 javax.servlet.http.HttpServlet无法构建问题解决方法
javax.servlet.zip\javax\servlet javax.servlet.zip\javax\servlet\http javax.servlet.zip\javax\servlet\jsp javax.servlet.zip\javax\servlet\jsp\tagext 源码
虽然通常我们不会直接继承这个类,但会实现`Servlet`接口的子接口`javax.servlet.GenericServlet`或`javax.servlet.http.HttpServlet`。 2. `javax.servlet.ServletConfig`:这个接口提供了Servlet的配置信息,例如...
在给定的源码包中,我们重点关注三个关键的Java包:`javax.servlet.*`,`javax.servlet.http.*`,以及`javax.servlet.jsp.*`。 1. `javax.servlet.*`: 这个包包含了Servlet的核心接口和类,是所有Servlet的基础。...
1. **servlet-api.jar**:这个文件通常包含Servlet规范中的核心接口和类,例如`javax.servlet.Servlet`、`javax.servlet.http.HttpServlet`以及`javax.servlet.ServletRequest`和`javax.servlet.ServletResponse`等...
【标题】"javax.servlet.jar" 和 "javax.servlet.jsp.jar" 是Java Web开发中不可或缺的核心库,主要用于构建基于Servlet和JSP(JavaServer Pages)的应用程序。这两个库是Java Enterprise Edition (Java EE) 的一...
`javax.servlet.jar`文件包含了Servlet API的主要类和接口,如`javax.servlet.Servlet`、`javax.servlet.http.HttpServlet`等,这些类和接口为开发人员提供了处理HTTP请求和响应的基本框架。例如,`Servlet`接口定义...
`javax.servlet.jar` 包是Java Servlet API的核心库,它包含了一系列用于开发Web应用程序的接口和类。这个库是Java平台企业版(Java EE)的一部分,允许开发者创建动态、交互式的Web服务。在Servlet技术中,`javax....
8. **Session管理**: javax.servlet.http.HttpSession接口用于管理客户端的会话。它可以创建、获取、移除会话属性,以及控制会话的有效期。 9. **Filter**: Filter是javax.servlet.filter包中的接口,用于在Servlet...
3. **HttpServlet**:`javax.servlet.http.HttpServlet`是`GenericServlet`的子类,专门针对HTTP协议。它提供了处理HTTP请求的方法,如`doGet()`、`doPost()`等,是大多数Web应用中Servlet的基类。 4. **...
javax.servlet 是Java编程语言中用于构建Web应用程序的标准API,它定义了服务器端Servlet和过滤器的接口和类。Servlet是一种Java程序,它可以接收并响应来自Web客户端(如浏览器)的请求,而过滤器则允许在请求处理...
`javax.servlet` 和 `jsp-api` 这两个关键词是Java服务器页面(JSP)和Servlet技术的核心部分,它们构成了Java Web开发的基础。在Java应用中,Servlet用于处理HTTP请求,而JSP则提供了方便的方式来创建动态网页。...