1. application is a "global context" object that can be used in JSP, which is equivalent to a "global access zone" in an application, as long as data is put into the application. setAttribute ("key", "value");), which can be used anywhere. getAttribute ("key. It is combined with request, session, and application as three context objects!
2. The method obtained in Servlet is as follows: ServletContext appliation = this. getServletContext ();
3. Another use of the application object is that it can obtain application-related data, such:
Application. getRealPath ("/"); to obtain the actual absolute path after the project is published to the server.
4. application. getInitParameter ("name");, you can obtain the following data in web. xml:
<Context-parameter>
<Parameter-name> name </parameter-name>
<Parmeter-value> available data </parameter-value>
</Context-parameter>