javaEE application

1用于保存整个WebApplication的生命周期内都可以访问的数据,任何客户端,任何浏览器都可以访问。

2在API中表现为ServletContext

3通过HttpServlet的getServletContext方法可以拿到,因为sevlet本身就extends HttpServlet,所以可以直接通过

ServletContext application =this.getServletContex();

4通过ServletContext的get/setAttribute方法取得/设置相关属性

你可能感兴趣的:(application)