1、servletcontext主要用在servlet中,当然也可以在jsp中使用;
2、application只在jsp页面中使用;
3、application和servletcontext都保存容器的全局信息;
4、application是对servletcontext在jsp中应用的包装,因此它们其实表示的是同一个对象,用application保存的属性可以用servletcontext来读取,反之亦同;
5、在jsp中可以直接使用application,也可以用getServletContext()方法来获得servletcontext对象,此对象的使用和application完全一样;
2、application只在jsp页面中使用;
3、application和servletcontext都保存容器的全局信息;
4、application是对servletcontext在jsp中应用的包装,因此它们其实表示的是同一个对象,用application保存的属性可以用servletcontext来读取,反之亦同;
5、在jsp中可以直接使用application,也可以用getServletContext()方法来获得servletcontext对象,此对象的使用和application完全一样;