📄 genericservlet.html
字号:
<DD><DL><DT><B>Returns:</B><DD>String information about this servlet, by default an empty string</DL></DD></DL><HR><A NAME="init(javax.servlet.ServletConfig)"><!-- --></A><H3>init</H3><PRE>public void <B>init</B>(<A HREF="../../javax/servlet/ServletConfig.html" title="interface in javax.servlet">ServletConfig</A> config) throws <A HREF="../../javax/servlet/ServletException.html" title="class in javax.servlet">ServletException</A></PRE><DL><DD>Called by the servlet container to indicate to a servlet that the servlet is being placed into service. See <A HREF="../../javax/servlet/Servlet.html#init(javax.servlet.ServletConfig)"><CODE>Servlet.init(javax.servlet.ServletConfig)</CODE></A>. <p>This implementation stores the <A HREF="../../javax/servlet/ServletConfig.html" title="interface in javax.servlet"><CODE>ServletConfig</CODE></A> object it receives from the servlet container for later use. When overriding this form of the method, call <code>super.init(config)</code>.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../javax/servlet/Servlet.html#init(javax.servlet.ServletConfig)">init</A></CODE> in interface <CODE><A HREF="../../javax/servlet/Servlet.html" title="interface in javax.servlet">Servlet</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>config</CODE> - the <code>ServletConfig</code> object that contains configutation information for this servlet<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/servlet/ServletException.html" title="class in javax.servlet">ServletException</A></CODE> - if an exception occurs that interrupts the servlet's normal operation<DT><B>See Also:</B><DD><A HREF="../../javax/servlet/UnavailableException.html" title="class in javax.servlet"><CODE>UnavailableException</CODE></A></DL></DD></DL><HR><A NAME="init()"><!-- --></A><H3>init</H3><PRE>public void <B>init</B>() throws <A HREF="../../javax/servlet/ServletException.html" title="class in javax.servlet">ServletException</A></PRE><DL><DD>A convenience method which can be overridden so that there's no need to call <code>super.init(config)</code>. <p>Instead of overriding <A HREF="../../javax/servlet/GenericServlet.html#init(javax.servlet.ServletConfig)"><CODE>init(ServletConfig)</CODE></A>, simply override this method and it will be called by <code>GenericServlet.init(ServletConfig config)</code>. The <code>ServletConfig</code> object can still be retrieved via <A HREF="../../javax/servlet/GenericServlet.html#getServletConfig()"><CODE>getServletConfig()</CODE></A>.<P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../javax/servlet/ServletException.html" title="class in javax.servlet">ServletException</A></CODE> - if an exception occurs that interrupts the servlet's normal operation</DL></DD></DL><HR><A NAME="log(java.lang.String)"><!-- --></A><H3>log</H3><PRE>public void <B>log</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> msg)</PRE><DL><DD>Writes the specified message to a servlet log file, prepended by the servlet's name. See <A HREF="../../javax/servlet/ServletContext.html#log(java.lang.String)"><CODE>ServletContext.log(String)</CODE></A>.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>msg</CODE> - a <code>String</code> specifying the message to be written to the log file</DL></DD></DL><HR><A NAME="log(java.lang.String, java.lang.Throwable)"><!-- --></A><H3>log</H3><PRE>public void <B>log</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> message, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Throwable.html" title="class or interface in java.lang">Throwable</A> t)</PRE><DL><DD>Writes an explanatory message and a stack trace for a given <code>Throwable</code> exception to the servlet log file, prepended by the servlet's name. See <A HREF="../../javax/servlet/ServletContext.html#log(java.lang.String, java.lang.Throwable)"><CODE>ServletContext.log(String, Throwable)</CODE></A>.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>message</CODE> - a <code>String</code> that describes the error or exception<DD><CODE>t</CODE> - the <code>java.lang.Throwable</code> error or exception</DL></DD></DL><HR><A NAME="service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)"><!-- --></A><H3>service</H3><PRE>public abstract void <B>service</B>(<A HREF="../../javax/servlet/ServletRequest.html" title="interface in javax.servlet">ServletRequest</A> req, <A HREF="../../javax/servlet/ServletResponse.html" title="interface in javax.servlet">ServletResponse</A> res) throws <A HREF="../../javax/servlet/ServletException.html" title="class in javax.servlet">ServletException</A>, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Called by the servlet container to allow the servlet to respond to a request. See <A HREF="../../javax/servlet/Servlet.html#service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)"><CODE>Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)</CODE></A>. <p>This method is declared abstract so subclasses, such as <code>HttpServlet</code>, must override it.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../javax/servlet/Servlet.html#service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)">service</A></CODE> in interface <CODE><A HREF="../../javax/servlet/Servlet.html" title="interface in javax.servlet">Servlet</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>req</CODE> - the <code>ServletRequest</code> object that contains the client's request<DD><CODE>res</CODE> - the <code>ServletResponse</code> object that will contain the servlet's response<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/servlet/ServletException.html" title="class in javax.servlet">ServletException</A></CODE> - if an exception occurs that interferes with the servlet's normal operation occurred<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if an input or output exception occurs</DL></DD></DL><HR><A NAME="getServletName()"><!-- --></A><H3>getServletName</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getServletName</B>()</PRE><DL><DD>Returns the name of this servlet instance. See <A HREF="../../javax/servlet/ServletConfig.html#getServletName()"><CODE>ServletConfig.getServletName()</CODE></A>.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../javax/servlet/ServletConfig.html#getServletName()">getServletName</A></CODE> in interface <CODE><A HREF="../../javax/servlet/ServletConfig.html" title="interface in javax.servlet">ServletConfig</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the name of this servlet instance</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../javax/servlet/FilterConfig.html" title="interface in javax.servlet"><B>PREV CLASS</B></A> <A HREF="../../javax/servlet/RequestDispatcher.html" title="interface in javax.servlet"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?javax/servlet/GenericServlet.html" target="_top"><B>FRAMES</B></A> <A HREF="GenericServlet.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../legal/license.html" target="_top">license terms.</a></font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -