JSP built-in object *application

Source: Internet
Author: User

Application ObjectBasic Concepts:it realizes the sharing of data among users and can store global variables. It starts at the start of the server until the server shuts down, and it is an instance of the ServletContext class. for an entire Web server, application has and only one instance  Method Description: Object getattribute (String key) returns the property value for the given name void SetAttribute (String key,object value) sets the property value of the property void RemoveAttribute (String name) deletes an attribute and its property value Enumeration Getattributenames () returns an enumeration of all available property names
String Getserverinfo () returns the JSP (SERVLET) engine name and version numberstring Getrealpath (string path) returns the true path of a virtual pathServletContext getcontext (String uripath) returns the Application object for the specified WebApplicationint getmajorversion () returns the maximum version number of the Servlet API supported by the serverint getminorversion () returns the maximum version number of the Servlet API supported by the serverstring GetMimeType (string file) returns the MIME type of the specified fileURL getresource (String path) returns the URL path for the specified resource (file and directory)inputstream getResourceAsStream (String path) returns the input stream for the specified resourcerequestdispatcher getrequestdispatcher (String uripath) returns the RequestDispatcher object for the specified resourceservlet getservlet (String name) returns the servlet of the specified nameenumeration Getservlets () returns an enumeration of all Servletsenumeration Getservletnames () returns an enumeration of all servlet namesvoid log (String msg) writes the specified message to the servlet's log filevoid log (Exception exception,string msg) writes the stack trace and error message of the specified exception to the servlet's log filevoid log (String msg,throwable throwable) writes the description information of the stack trajectory and the given Throwable exception to the servlet's log file   

JSP built-in object *application

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.