Danh mục

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

Số trang: 10      Loại file: pdf      Dung lượng: 168.49 KB      Lượt xem: 6      Lượt tải: 0    
Thư viện của tui

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- P24: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- P24 Parameters CookiecontainsHeader() Methodpublic boolean containsHeader(java.lang.String name)The containsHeader() method returns true if the named header exists in theresponse. containsHeader() throws no exceptions. Parameters java.lang.String Returns booleanencodeURL() Methodpublic java.lang.String encodeURL(java.lang.String url)The encodeURL() methods URL encodes the passed-in String and returns it. If nochanges are necessary, then it simply returns the String. encodeURL() throws noexceptions. Parameters java.lang.String Returns java.lang.StringencodeRedirectURL() Method public java.lang.String encodeRedirectURL(java.lang.String url)The encodeRedirectURL() methods URL encodes the passed in String for usein the sendRedirect() method. If no changes are necessary, then it simply returnsthe String. encodeRedirectURL() throws no exceptions. Parameters java.lang.String Returns java.lang.StringsendError(int sc, java.lang.String message) Methodpublic void sendError(int sc, java.lang.String message)throws java.io.IOExceptionThe sendError() method sends an error to the client in the response object. Theerror consists of the int status code and a String message. sendError() returnsno value. Parameters int java.lang.String Exceptions Thrown java.io.IOExceptionsendError(int sc) Methodpublic void sendError(int sc)throws java.io.IOException - 231 - This sendError() method sends an error to the client in the response object. The error consists of only the int status code. sendError() returns no value. Parameters int Exceptions Thrown java.io.IOException sendRedirect() Method public void sendRedirect(java.lang.String url) throws java.io.IOException The sendRedirect() method redirects the client to the passed-in URL, which must be an absolute URL. sendRedirect() returns no value. Parameters java.lang.String Exceptions Thrown java.io.IOException setDateHeader() Method public void setDateHeader(java.lang.String name, long date) The setDateHeader() method adds a name/date-value field to the response header. The date value is a long representing milliseconds since the epoch. setDateHeader() returns no value and throws no exception. Parameters java.lang.String long setIntHeader() Method public void setIntHeader(java.lang.String name, int value) The setIntHeader() method adds a name/int-value field to the response header. If the field is already present in the request, it is replaced. setIntHeader() returns no value and throws no exceptions. Parameters java.lang.String int setStatus() Method public void setStatus(int sc) The setStatus() method sets the status code for the response. setStatus() returns no value and throws no exceptions. Parameters intHttpSession Interfacepublic interface HttpSessionThe HttpSession interface defines an object that provides an association between aclient and server persisting over multiple connections. Using HttpSession gives you the - 232 -ability to maintain state between transactions. This interface has 12 methods, described inthe following sections. getAttribute() Method public java.lang.Object getAttribute(java.lang.String name) The getAttribute() method returns a reference to the named object in the current session. The object must be downcasted to its original type. getAttribute() throws no exceptions. Parameters java.lang.String Returns java.lang.Object getAttributeNames() Method public Enumeration getAttributeNames() The getAttributeNames() method returns an Enumeration of Strings representing all of the data objects bound to this session. getAttributeNames() has no parameters and throws no exceptions. Returns Enumeration getCreationTime() Method public long getCreationTime() The getCreationTime() method returns the time in which the session was created. This time value is a long representing the milliseconds elapsed since January 1, 1970 UTC. getCreationTime() has no parameters and throws no exceptions. Returns long getId() Method public java.lang.String getId() The getId() method returns a String containing a unique identifier for the current HttpSession. getId() has no parameters and throws no exceptions. Returns java.lang.String getLastAccessedTime() Method public long getLastAccessedTime() The getLastAccessedTime() method returns the last time, in milliseconds, the client sent a request with HttpSession. getLastAccessedTime() has no parameters and throws no exceptions. Returns long getMaxIntervalTime() Method public int getMaxIntervalTime() The getMaxIntervalTime() method returns the maximum interval between requests that the server will keep the session valid. getMaxIntervalTime() has no parameters and throws no exceptions. - 233 - Returns intgetSessionContext() Methodpublic HttpSessionContext getSessionContext()The getSessionContext() method returns a reference to a HttpSessionContextobject bound to the current session. getSessionContext() has no parameters andthrows no exceptions. Returns HttpSessionContextinvalidate() Methodpublic void invalidate()The invalidate() method forces the session to be invalidated and removed fromthe context. invalidate() has no parameters, returns no value, and throws noexceptions.isNew() Methodpublic boolean isNew()The isNew() method returns true if the server has just created the session andthe session has not been acknowledged by the client. isNew() has no parametersand throws no exceptions. Returns booleansetAttribute() Methodpublic void setAttribute( ...

Tài liệu được xem nhiều:

Tài liệu cùng danh mục:

Tài liệu mới: