Description: This instance represents the WEB application itself that the JSP belongs to, for use in JSP pages, or for information exchange between Servlets. Common methods are getattribute (name, value), SetAttribute (name, value), Getinitparameter (name), and so on.
Instance:
Declare a variable i on the a.jsp page and put this value in application named "Counter"
<%! int i; %>
<%application.setattribute ("Counter", String.valueof (++i));%>
After you put application, you can invoke the value of "counter" on any page.
<%=application.getattribute ("Counter")%>
Application also has an important purpose: the configuration parameters that can be used to obtain the Web application (XML).
Use the <context-param> element configuration in the Web. xml file, and parameters <param-name> <param-value> for example:
in the JSP page, you can use application to take out parameters:
In this way, some information can be configured in the Web. xml file to improve the portability of the program.
Application understanding and use