⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 servletcontext.java

📁 JSWDK服务器
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
     * in a future version of the Java Servlet API.
     *
     */

    public Servlet getServlet(String name) throws ServletException;
    
  
  
  
    

    /**
     *
     *
@deprecated	As of Java Servlet API 2.0, with no replacement.
     *
     * <p>This method was originally defined to return an <code>Enumeration</code>
     * of all the servlets known to this servlet context. In this
     * version, this method always returns an empty enumeration and
     * remains only to preserve binary compatibility. This method
     * will be permanently removed in a future version of the Java
     * Servlet API.
     *
     */
    
    public Enumeration getServlets();
    
    
    
    
    

    /**
     * @deprecated	As of Java Servlet API 2.1, with no replacement.
     *
     * <p>This method was originally defined to return an 
     * <code>Enumeration</code>
     * of all the servlet names known to this context. In this version,
     * this method always returns an empty <code>Enumeration</code> and 
     * remains only to preserve binary compatibility. This method will 
     * be permanently removed in a future version of the Java Servlet API.
     *
     */
 
    public Enumeration getServletNames();
    
  
  
    
    
    /**
     *
     * Writes the specified message to a servlet log file, which is usually
     * an event log. The message provides explanatory information about
     * an exception or error or an action the servlet engine takes. The name 
     * and type of the servlet log file is specific to the servlet engine.
     *
     *
     * @param msg 	a <code>String</code> specifying the explanatory
     *			message to be written to the log file
     *
     */
     
    public void log(String msg);
    
    
    
    

    /**
     * @deprecated	As of Java Servlet API 2.1, use
     * 			{@link log(String message, Throwable throwable)} 
     *			instead.
     *
     * <p>This method was originally defined to write an 
     * exception's stack trace and an explanatory error message
     * to the servlet log file.
     *
     */

    public void log(Exception exception, String msg);
    
    
    
    

    /**
     * Writes the stack trace and an explanatory message
     * for a given <code>Throwable</code> exception
     * to the servlet log file. The stack trace is
     * part of the <code>Throwable</code> object, and
     * the message is the one you specify in the <code>message</code>
     * parameter. The name and type of the servlet log file is specific to 
     * the servlet engine, but it is usually an event log.
     *
     *
     * @param message 		a <code>String</code> that 
     *				describes the error or exception
     *
     * @param throwable 	the <code>Throwable</code> error 
     *				or exception
     *
     */
    
    public void log(String message, Throwable throwable);
    
    
    
    
    
    /**
     * Returns a <code>String</code> containing the real path 
     * that corresponds to a virtual path. A virtual path contains 
     * a servlet name followed by the name of a file the servlet 
     * should act upon, in the form 
     * <code><i>/dir/dir/servlet/file.ext</i></code>.
     * In this form, <i>file.ext</i> is a filename used instead
     * of the path to the file. The servlet locates the file and 
     * translates the file name to the path that locates the file.
     *
     * <p>The real path the servlet returns is in a form
     * appropriate to the computer and operating system on
     * which the servlet engine is running, including the
     * proper path separators. This method returns <code>null</code>
     * if the servlet engine cannot translate the virtual path
     * to a real path for any reason.
     *
     *
     * @param path 	a <code>String</code> specifying a virtual path,
     *			in the form 
     *			<code><i>/dir/dir/servlet/file.ext</i></code>
     *
     *
     * @return 		a <code>String</code> specifying the real path,
     *			with path separators appropriate for the system
     *			on which the servlet engine is running
     *			
     *
     */

    public String getRealPath(String path);
    
    


    /**
     * Returns the name and version of the servlet engine on which
     * the servlet is running. 
     *
     * <p>The form of the returned string is <i>servername</i>/<i>versionnumber</i>.
     * For example, the Java Web Server can return the string
     * <code>Java Web Server/1.1.3</code>.
     *
     * <p>You can design the servlet engine to have this method return 
     * other optional information in parentheses after the primary string, 
     * for example,
     * <code>Java Web Server/1.1.3 (JDK 1.1.6; Windows NT 4.0 x86)</code>.
     *
     *
     * @return 		a <code>String</code> containing at least the 
     *			servlet engine name and version number
     *
     */

    public String getServerInfo();
    
    

    /**
     * Returns the servlet engine attribute with the given name, 
     * or <code>null</code>
     * if there is none. An attribute allows a servlet engine to give the
     * servlet additional information not
     * already provided by this interface. See your
     * Web server documentation for information about its attributes.
     *
     * <p>The attribute is returned as a <code>java.lang.Object</code>.
     * Attribute names should follow the same convention as package
     * names. The Java Servlet API specification reserves names
     * matching <code>java.*</code>, <code>javax.*</code>,
     * and <code>sun.*</code>.
     *
     * @param name 	a <code>String</code> specifying the name 
     *			of the attribute
     *
     * @return 		an <code>Object</code containing the value 
     *			of the attribute, or <code>null</code>
     *			if no attribute exists matching the given
     *			name
     *
     *
     */
  
    public Object getAttribute(String name);
    
    
    

    /**
     * Returns an <code>Enumeration</code> containing the 
     * attribute names available
     * within this servlet context. You can use the
     * {@link #getAttribute} method with an attribute name
     * to get the value of an attribute.
     *
     * @return 		an <code>Enumeration</code> of attribute 
     *			names
     *
     * @see		#getAttribute
     *
     */

    public Enumeration getAttributeNames();
    
    
    
    
    /**
     *
     * Gives an attribute a name in this servlet context. If
     * the name specified is already used for an attribute, this
     * method will overwrite the old attribute and bind the name
     * to the new attribute.
     *
     * <p>Attribute names should follow the same convention as package
     * names. The Java Servlet API specification reserves names
     * matching <code>java.*</code>, <code>javax.*</code>, and
     * <code>sun.*</code>.
     *
     *
     * @param name 	a <code>String</code> specifying the name 
     *			of the attribute
     *
     *
     * @param object 	an <code>Object</code> representing the
     *			attribute to be given the name
     *
     *
     *
     */
    
    public void setAttribute(String name, Object object);
    
    



    /**
     * Removes the attribute with the given name from 
     * the servlet context. If you remove an attribute, and 
     * then use {@link #getAttribute} to retrieve the 
     * attribute's value, <code>getAttribute</code> returns <code>null</code>.
     *
     *
     * @param name	a <code>String</code> specifying the name 
     * 			of the attribute to be removed
     *
     */

    public void removeAttribute(String name);
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -