ServletConfig与ServletContext [英] ServletConfig vs ServletContext

查看:128
本文介绍了ServletConfig与ServletContext的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ServletConfigServletContext接口之间有什么区别?

What is the difference between ServletConfig and ServletContext interface?

推荐答案

为特定的servlet指定ServletConfig参数,而其他servlet则不知道.它用于初始化目的.

The ServletConfig parameters are specified for a particular servlet and are unknown to other servlets. It is used for intializing purposes.

ServletContext参数是为任何特定servlet之外的整个应用程序指定的,并且可用于该应用程序内的所有servlet.它是应用程序范围内的,因此可以跨页面全局访问.

The ServletContext parameters are specified for an entire application outside of any particular servlet and are available to all the servlets within that application. It is application scoped and thus globally accessible across the pages.

这篇关于ServletConfig与ServletContext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆