Danh mục tài liệu

Java Server Pages: A Code-Intensive Premium Reference- P23

Số trang: 10      Loại file: pdf      Dung lượng: 215.77 KB      Lượt xem: 17      Lượt tải: 0    
Xem trước 2 trang đầu tiên của tài liệu này:

Thông tin tài liệu:

Java Server Pages: A Code-Intensive Premium Reference- P23:Before you begin reading Pure JSP Java Server Pages, you might want to take a look at its basicstructure. This should help you outline your reading plan if you choose not to read the text from cover tocover. This introduction gives you an overview of what each chapter covers.
Nội dung trích xuất từ tài liệu:
Java Server Pages: A Code-Intensive Premium Reference- P23This version of the println() method prints the passed in int value to the output stream, followed by aCRLF.Parameters intprintln(long value) Methodpublic void println(long value) throws java.io.IOExceptionThis version of the println() method prints the passed in long value to the output stream, followed bya CRLF.Parameters longprintln(float value) Methodpublic void println(float value) throws java.io.IOExceptionThis version of the println() method prints the passed in float value to the output stream, followed bya CRLF.Parameters floatprintln(double value) Methodpublic void println(double value) throws java.io.IOExceptionThis version of the println() method prints the passed in double value to the output stream, followedby a CRLF.Parameters doubleChapter 21: The javax.servlet.http PackageOverviewThe java.servlet.http package contains the interfaces and classes that are implemented andextended, respectively, to create HTTP-specific servlets. Figure 21.1 contains the javax.servlet.httpobject model. - 221 -Figure 21.1: The javax.servlet.http object model. Interfaces Interfaces for the java.servlet.http package are HttpServletRequest, HttpServletResponse, HttpSession, and HttpSessionBindingListener. HttpServletRequest Interface public interface HttpServletRequest extends ServletRequest The HttpServletRequest interface defines an object that provides the HttpServlet.service() method with access to HTTP-protocol–specific header information sent by the client. The HttpServletRequest interface has 26 methods, described in the following sections. addHeader() Method public void addHeader(java.lang.String name, java.lang.String value) The addHeader() method adds another value to the response for the given header. addHeader() returns no value and throws no exceptions. Parameters java.lang.String java.lang.String addDateHeader() Method public void addDateHeader(java.lang.String name, long date) The addDateHeader() method adds another date value to the response for the given header. addDateHeader() returns no value and throws no exceptions. Parameters java.lang.String - 222 - longaddIntHeader() Methodpublic void addIntHeader(java.lang.String name, int value)The addIntHeader() method adds another int value to the response for the givenheader. addIntHeader() returns no value and throws no exceptions. Parameters java.lang.String intgetAuthType() Methodpublic java.lang.String getAuthType()The getAuthType() method returns the authentication scheme used in this request.It is the same as the AUTH_TYPE CGI variable. getAuthType() has no parametersand throws no exceptions. Returns java.lang.StringgetContextPath() Methodpublic java.lang.String getContextPath()The getContextPath() method returns the context path of this request.getContextPath() has no parameters and throws no exceptions. Returns java.lang.StringgetCookies() Methodpublic Cookie[] getCookies()The getCookies() method returns an array of Cookie objects found in the clientrequest. getCookies() has no parameters and throws no exceptions. Returns Cookie[]getDateHeader() Methodpublic long getDateHeader(java.lang.String name)The getDateHeader() method returns the value of the requested date header fieldfound in the client request. getDateHeader() throws no exceptions. Parameters java.lang.String Returns longgetHeader() Methodpublic java.lang.String getHeader(java.lang.String name)The getHeader() method returns the value of the requested header field found in theclient request. getHeader() throws no exceptions. Parameters java.lang.String Returns java.lang.String - 223 -getHeaders() Methodpublic Enumeration getHeaders(java.lang.String name)The getHeaders() method returns an Enumeration of Strings containing all ofthe values for the given header. getHeaders() throws no exceptions. Parameters java.lang.String Returns EnumerationgetHeaderNames() Methodpublic Enumeration getHeaderNames()The getHeaderNames() method returns an Enumeration containing all of theheader names found in the client request. getHeaderNames() has no parametersand throws no exceptions. Returns EnumerationgetIntHeader() Methodpublic int getIntHeader(java.lang.String name)The getIntHeader() method returns the int value of the named header field,found in the client request. getIntHeader() throws no exceptions. Parameters java.lang.String Returns intgetMethod() Methodpublic java.lang.String getMethod()The getMethod() method returns the HTTP method used by the client request. It isthe same as the CGI variable REQUEST_METHOD. getMethod() has no parametersand throws no exceptions. Returns java.lang.StringgetPathInfo() Methodpublic java.lang.String getPathInfo()The getPathInfo() method returns a String containing any additional pathinformation following the servlet path, but preceding the query string. It is the same asthe CGI variable PATH_INFO. getPathInfo() has no parameters and throws noexceptions. Returns java.lang.StringgetPathTranslated() Methodpublic java.lang.String getPathTranslated()The getPathTranslated() method returns the same information as thegetPathInfo() method, but translates the path to its real path name beforereturning it. It is the same as the CGI variable PATH_TRANSLATED.getPathTranslated() has no parameters and throws no exceptions. - 224 - Returns java.lang.StringgetQueryString() Methodpublic java. ...