亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? httpservlet.java

?? 使用java語言編寫的小應用程序
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/*
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 1999 The Apache Software Foundation.  All rights 
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer. 
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution, if
 *    any, must include the following acknowlegement:  
 *       "This product includes software developed by the 
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowlegement may appear in the software itself,
 *    if and wherever such third-party acknowlegements normally appear.
 *
 * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
 *    Foundation" must not be used to endorse or promote products derived
 *    from this software without prior written permission. For written 
 *    permission, please contact apache@apache.org.
 *
 * 5. Products derived from this software may not be called "Apache"
 *    nor may "Apache" appear in their names without prior written
 *    permission of the Apache Group.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 *
 * ====================================================================
 *
 * This source code implements specifications defined by the Java
 * Community Process. In order to remain compliant with the specification
 * DO NOT add / change / or delete method signatures!
 */ 


package javax.servlet.http;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Method;
import java.text.MessageFormat;
import java.util.Enumeration;
import java.util.Locale;
import java.util.ResourceBundle;

import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;


/**
 *
 * Provides an abstract class to be subclassed to create
 * an HTTP servlet suitable for a Web site. A subclass of
 * <code>HttpServlet</code> must override at least 
 * one method, usually one of these:
 *
 * <ul>
 * <li> <code>doGet</code>, if the servlet supports HTTP GET requests
 * <li> <code>doPost</code>, for HTTP POST requests
 * <li> <code>doPut</code>, for HTTP PUT requests
 * <li> <code>doDelete</code>, for HTTP DELETE requests
 * <li> <code>init</code> and <code>destroy</code>, 
 * to manage resources that are held for the life of the servlet
 * <li> <code>getServletInfo</code>, which the servlet uses to
 * provide information about itself 
 * </ul>
 *
 * <p>There's almost no reason to override the <code>service</code>
 * method. <code>service</code> handles standard HTTP
 * requests by dispatching them to the handler methods
 * for each HTTP request type (the <code>do</code><i>XXX</i>
 * methods listed above).
 *
 * <p>Likewise, there's almost no reason to override the 
 * <code>doOptions</code> and <code>doTrace</code> methods.
 * 
 * <p>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
 * <a href="http://java.sun.com/Series/Tutorial/java/threads/multithreaded.html">
 * Java Tutorial on Multithreaded Programming</a> for more
 * information on handling multiple threads in a Java program.
 *
 * @author	Various
 * @version	$Version$
 *
 */



public abstract class HttpServlet extends GenericServlet
    implements java.io.Serializable
{
    private static final String METHOD_DELETE = "DELETE";
    private static final String METHOD_HEAD = "HEAD";
    private static final String METHOD_GET = "GET";
    private static final String METHOD_OPTIONS = "OPTIONS";
    private static final String METHOD_POST = "POST";
    private static final String METHOD_PUT = "PUT";
    private static final String METHOD_TRACE = "TRACE";

    private static final String HEADER_IFMODSINCE = "If-Modified-Since";
    private static final String HEADER_LASTMOD = "Last-Modified";
    
    private static final String LSTRING_FILE =
	"javax.servlet.http.LocalStrings";
    private static ResourceBundle lStrings =
	ResourceBundle.getBundle(LSTRING_FILE);
   
   
   
    
    /**
     * Does nothing, because this is an abstract class.
     * 
     */

    public HttpServlet() { }
    
    

    /**
     *
     * Called by the server (via the <code>service</code> method) to
     * allow a servlet to handle a GET request. 
     *
     * <p>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.
     *
     * <p>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 <code>PrintWriter</code> object to return the response,
     * set the content type before accessing the
     * <code>PrintWriter</code> object.
     *
     * <p>The servlet container must write the headers before
     * committing the response, because in HTTP the headers must be sent
     * before the response body.
     *
     * <p>Where possible, set the Content-Length header (with the
     * {@link javax.servlet.ServletResponse#setContentLength} 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.
     * 
     * <p>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.
     *
     * <p>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. 
     *
     * <p>If the request is incorrectly formatted, <code>doGet</code>
     * returns an HTTP "Bad Request" message.
     * 
     *
     * @param req	an {@link HttpServletRequest} object that
     *			contains the request the client has made
     *			of the servlet
     *
     * @param resp	an {@link HttpServletResponse} object that
     *			contains the response the servlet sends
     *			to the client
     * 
     * @exception IOException	if an input or output error is 
     *				detected when the servlet handles
     *				the GET request
     *
     * @exception ServletException	if the request for the GET
     *					could not be handled
     *
     * 
     * @see javax.servlet.ServletResponse#setContentType
     *
     */

    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
	throws ServletException, IOException
    {
	String protocol = req.getProtocol();
	String msg = lStrings.getString("http.method_get_not_supported");
	if (protocol.endsWith("1.1")) {
	    resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
	} else {
	    resp.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
	}
    }





    /**
     *
     * Returns the time the <code>HttpServletRequest</code>
     * 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).
     *
     * <p>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.
     *
     *
     * @param req	the <code>HttpServletRequest</code> 
     *			object that is sent to the servlet
     *
     * @return		a <code>long</code> integer specifying
     *			the time the <code>HttpServletRequest</code>
     *			object was last modified, in milliseconds
     *			since midnight, January 1, 1970 GMT, or
     *			-1 if the time is not known
     *
     */

    protected long getLastModified(HttpServletRequest req) {
	return -1;
    }




    /*
     * Private method; not a Javadoc comment
     *
     * <p>Receives an HTTP HEAD request from the protected
     * <code>service</code> 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.
     *
     * <p>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
     * <code>doHead</code> method you write is both safe
     * and idempotent (that is, protects itself from being
     * called multiple times for one HTTP HEAD request).
     *
     * <p>If the HTTP HEAD request is incorrectly formatted,
     * <code>doHead</code> returns an HTTP "Bad Request"
     * message.
     *
     *
     * @param req	the request object that is passed
     *			to the servlet
     *			
     * @param resp	the response object that the servlet
     *			uses to return the headers to the clien
     *
     * @exception IOException		if an input or output error occurs
     *
     * @exception ServletException	if the request for the HEAD
     *					could not be handled
     */

    private void doHead(HttpServletRequest req, HttpServletResponse resp)
	throws ServletException, IOException
    {
	NoBodyResponse response = new NoBodyResponse(resp);
	
	doGet(req, response);
	response.setContentLength();
    }
    




    /**
     *
     * Called by the server (via the <code>service</code> 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.
     *
     * <p>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
     * <code>PrintWriter</code> object to return the response, set the 
     * content type before accessing the <code>PrintWriter</code> object. 
     *
     * <p>The servlet container must write the headers before committing the
     * response, because in HTTP the headers must be sent before the 
     * response body.
     *
     * <p>Where possible, set the Content-Length header (with the
     * {@link javax.servlet.ServletResponse#setContentLength} 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.  
     *
     * <p>When using HTTP 1.1 chunked encoding (which means that the response
     * has a Transfer-Encoding header), do not set the Content-Length header. 
     *
     * <p>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, 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三区视频在线观看| 国产精品国产自产拍高清av王其| 国产日产精品1区| 亚洲裸体在线观看| 国精品**一区二区三区在线蜜桃 | 国产精品国模大尺度视频| 亚洲va韩国va欧美va| av在线综合网| 国产视频在线观看一区二区三区 | 中国色在线观看另类| 青青草成人在线观看| 欧美亚洲自拍偷拍| 国产精品麻豆网站| 国产精品一区二区在线观看网站| 777a∨成人精品桃花网| 亚洲免费在线看| 99在线精品一区二区三区| 久久精品欧美日韩| 国产尤物一区二区在线| 日韩一区二区免费视频| 日韩精品91亚洲二区在线观看| 色婷婷精品久久二区二区蜜臂av | 日韩视频免费直播| 午夜欧美电影在线观看| 欧美伊人精品成人久久综合97| 中日韩av电影| 高清不卡在线观看av| 国产欧美中文在线| 国产成a人无v码亚洲福利| 精品国产乱子伦一区| 狠狠色综合色综合网络| 精品国产乱码久久久久久蜜臀| 久久av老司机精品网站导航| 这里只有精品99re| 久久综合综合久久综合| 精品欧美一区二区久久| 狠狠久久亚洲欧美| 久久久久久久久久久黄色| 国产精品一品二品| 国产精品乱人伦一区二区| 成人高清免费观看| 亚洲欧美日韩系列| 欧美三区免费完整视频在线观看| 亚洲va中文字幕| 欧美另类久久久品| 麻豆91精品视频| 亚洲精品一区二区三区影院| 国产91精品在线观看| 自拍av一区二区三区| 欧美色图12p| 男女激情视频一区| 国产午夜精品理论片a级大结局| 成人免费观看视频| 一区2区3区在线看| 亚洲国产精品国自产拍av| 丁香激情综合国产| 亚洲精品国产无天堂网2021| 91精品国产一区二区人妖| 国产一区二三区好的| 最新热久久免费视频| 欧美日本国产一区| 国产精品99久久久久久似苏梦涵| 自拍偷拍亚洲综合| 日韩一级片网址| 成人激情视频网站| 日产欧产美韩系列久久99| 日本一区二区在线不卡| 欧美色视频一区| 国产乱理伦片在线观看夜一区| 亚洲女性喷水在线观看一区| 日韩一区二区三区在线观看| www.亚洲色图| 奇米色一区二区| 日韩理论片在线| 欧美电影免费观看高清完整版在| 成人黄色av电影| 美日韩黄色大片| 亚洲美女在线一区| 久久久久久久av麻豆果冻| 欧美在线免费观看亚洲| 国产精品白丝jk黑袜喷水| 无码av中文一区二区三区桃花岛| 国产亚洲精久久久久久| 91精品国产综合久久精品app| 成人精品视频一区二区三区尤物| 日韩电影在线一区二区三区| 国产精品久久夜| 精品国产乱码久久久久久浪潮 | 国产99久久久精品| 日韩高清电影一区| 亚洲精品久久久蜜桃| 国产喷白浆一区二区三区| 欧美一区二区三区不卡| 欧日韩精品视频| 不卡av免费在线观看| 国产精一区二区三区| 三级一区在线视频先锋| 亚洲一二三四久久| 亚洲女爱视频在线| 国产精品美女久久久久高潮| 久久久亚洲午夜电影| 精品日韩av一区二区| 这里只有精品99re| 777亚洲妇女| 在线播放视频一区| 欧美理论在线播放| 精品视频一区二区三区免费| 色婷婷久久久久swag精品| 99re热这里只有精品视频| 成人毛片视频在线观看| 国产传媒日韩欧美成人| 国产精品亚洲成人| 高清成人免费视频| 成人教育av在线| 99久久精品国产一区| 91在线精品一区二区三区| 91啪亚洲精品| 91精品福利在线| 欧美色涩在线第一页| 在线播放国产精品二区一二区四区 | 欧美日韩aaaaa| 91麻豆精品国产综合久久久久久| 777午夜精品免费视频| 日韩一区二区精品| 欧美va亚洲va在线观看蝴蝶网| 日韩一卡二卡三卡四卡| 精品国产乱码久久久久久图片 | 成人av在线播放网站| 99精品视频在线观看| 在线观看成人免费视频| 91精品啪在线观看国产60岁| 亚洲精品一区二区三区四区高清| 久久欧美中文字幕| 中文字幕一区二| 亚洲一区二区在线免费观看视频| 五月激情丁香一区二区三区| 久久精品国产久精国产| 高清免费成人av| 在线视频一区二区免费| 欧美一级一级性生活免费录像| 久久久久久亚洲综合| 亚洲色图视频网| 亚洲一区二区黄色| 久久成人免费日本黄色| 成人黄色片在线观看| 欧美性生活久久| 久久亚洲捆绑美女| 最新热久久免费视频| 美女尤物国产一区| 一本色道久久综合精品竹菊| 在线综合亚洲欧美在线视频| 国产精品无圣光一区二区| 亚洲男帅同性gay1069| 日本免费在线视频不卡一不卡二| 国产成人免费视频精品含羞草妖精| 在线中文字幕不卡| 2019国产精品| 午夜视频一区在线观看| 国产98色在线|日韩| 欧美日韩国产在线观看| 国产欧美精品一区二区色综合朱莉| 欧美高清在线视频| 久久精品99国产精品日本| 99久久综合精品| 欧美精品一区二区三区一线天视频 | 一区二区三区久久| 国产精品一二三四| 欧美美女bb生活片| 亚洲色图在线视频| 国产综合色视频| 7777精品伊人久久久大香线蕉最新版| 国产精品久久久爽爽爽麻豆色哟哟| 午夜视频久久久久久| 91最新地址在线播放| 久久久午夜精品| 国产91精品露脸国语对白| 欧美日韩精品一二三区| 亚洲人成精品久久久久| 国产成人亚洲精品狼色在线 | 天天综合网天天综合色 | 激情久久五月天| 欧美一级xxx| 日韩精品亚洲一区| 欧美综合天天夜夜久久| 亚洲色图都市小说| av一区二区三区黑人| 国产人久久人人人人爽| 国产在线视频一区二区三区| 91麻豆精品91久久久久同性| 亚洲一区日韩精品中文字幕| 99久久精品国产观看| 国产精品进线69影院| 成人h动漫精品一区二| 国产日韩v精品一区二区| 精油按摩中文字幕久久| 日韩一区二区三区电影| 久久99久久99| 欧美精品一区二| 国产精品夜夜嗨| 欧美极品aⅴ影院|