Danh mục tài liệu

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

Số trang: 10      Loại file: pdf      Dung lượng: 169.03 KB      Lượt xem: 13      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- P21: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- P21getServletName() Methodpublic java.lang.String getServletName()The getServletName() method returns the registered servlets name. getServletName() has noparameters and throws no exceptions.Returns java.lang.StringgetInitParameter() Methodpublic java.lang.String getInitParameter(java.lang.String)The getInitParameter() method returns a String containing the value of the initializationparameters name/value pair referenced by the passed in String representing the name.getInitParameter() throws no exceptions.Parameters java.lang.StringReturns java.lang.StringgetInitParameterNames() Methodpublic java.util.Enumeration getInitParameterNames()The getInitParameterNames() method returns an Enumeration of Strings representing all of theinitialization parameters names. getInitParameterNames() takes no parameters and throws noexceptions.Returns java.util.EnumerationServletContext Interfacepublic interface ServletContextThe ServletContext interface defines an object, to be created by a servlet engine, that containsinformation about the servlets environment. This interface provides several methods to access thisinformation.getContext() Methodpublic ServletContext getContext(java.lang.String uripath)The getContext() method returns a reference to a ServletContext object belonging to a particularURI path. getContext() throws no exceptions.Parameters java.lang.StringReturns ServletContextgetInitParameter() Methodpublic java.lang.String getInitParameter(java.lang.String name)The getInitParameter() method returns the value for the named context parameter.getInitParameter() throws no exceptions.Parameters java.lang.StringReturns java.lang.String - 201 -getInitParameterNames() Methodpublic Enumeration getInitParameterNames()The getInitParameterNames() method returns an Enumeration of all the context parameter names.getInitParameterNames() has no parameters and throws no exceptions.Returns EnumerationgetMajorVersion() Methodpublic int getMajorVersion()The getMajorVersion() method returns an integer representing the major version of the servlet APIthat the servlet engine supports. If the servlet engine supported the servlet API 2.1, the result would be 2.getMajorVersion() has no parameters and throws no exceptions.Returns intgetMinorVersion() Methodpublic int getMinorVersion()The getMinorVersion() method returns an integer representing the minor version of the servlet APIthat the servlet engine supports. If the servlet engine supported the servlet API 2.1, the result would be 1.getMinorVersion() has no parameters and throws no exceptions.Returns intgetMimeType() Methodpublic java.lang.String getMimeType(java.lang.String file)The getMimeType() method returns a String representing the MIME type of the passed in file name,or null if the MIME type of the file is not known. getMimeType() throws no exceptions.Parameters java.lang.StringReturns java.lang.StringgetNamedDispatcher() Methodpublic RequestDispatcher getNamedDispatcher(java.lang.String name)The getNamedDispatcher() method returns a reference to a RequestDispatcher object belongingto a particular URI path. The getNamedDispatcher() method throws no exceptions.Parameters java.lang.StringReturns RequestDispatchergetResource() Methodpublic java.net.URL getResource(java.lang.String path) throws java.net.MalformedURLExceptionThe getResource() method returns a URL object of a resource matching the passed in path parameter,permitting a servlet to access content from the servlet engines document space without systemdependencies.Parameters - 202 - java.lang.StringReturns java.net.URLExceptions Thrown java.net.MalformedURLExceptiongetResourceAsStream() Methodpublic java.io.InputStream getResourceAsStream(java.lang.String path)The getResourceAsStream() method returns an InputStream object, which allows access to theresource matching the passed in URL path. getResourceAsStream() throws no exceptions.Parameters java.lang.StringReturns java.io.InputStreamgetRequestDispatcher() Methodpublic RequestDispatcher getRequestDispatcher(java.lang.String urlpath)The getRequestDispatcher() method returns a RequestDispatcher object based on the passed inURL path. getRequestDispatcher() throws no exceptions.Parameters java.lang.StringReturns RequestDispatcherlog(java.lang.String msg) Methodpublic void log(java.lang.String msg)The log() method writes the passed in message to the contexts log. The location of the log is servletengine specific. log() returns no value and throws no exceptions.Parameters java.lang.Stringlog(java.lang.String msg, java.lang.Throwable throwable) Methodpublic void log(java.lang.String msg, java.lang.Throwable throwable)This log() method writes the passed in message and the stack trace of the passed in Throwable objectto the contexts log. The location of the log is servlet engine specific. log() returns no value and throwsno exceptions.Parameters java.lang.String java.lang.ThrowablegetRealPath() Methodpublic java.lang.String getRealPath(java.lang.String path)The getRealPath() method returns a String representing the passed in virtual path converted to thereal path based on the operating system that the servlet engine is running on. getRealPath() throwsno exceptions. - 203 -Parameters java.lang.StringReturns java.lang.StringgetServer Info() Methodpublic java.lang.String getServerInfo()The getServerInfo() method returns a String representing the nam ...