ServletContext
来源:互联网 发布:进入windows后黑屏 编辑:程序博客网 时间:2024/05/16 18:22
ServletContext:
1.WEB容器在启动时,它会为每个WEB应用程序都创建一个对应的ServletContext对象,它代表当前web应用。
2.ServletConfig对象中维护了ServletContext对象的引用,开发人员在编写servlet时,可以通过ServletConfig.getServletContext方法获得ServletContext对象。
3.由于一个WEB应用中的所有Servlet共享同一个ServletContext对象,因此Servlet对象之间可以通过ServletContext对象来实现通讯。ServletContext对象通常也被称之为context域对象。
1.多个Servlet通过ServletContext对象实现数据共享。
2.获取WEB应用的初始化参数。
3.实现Servlet的转发。
4.利用ServletContext对象读取资源文件。
(1).properties文件(属性文件)
(2)得到文件路径(ServletContext.getRealPath(),ServletContext.getReaourceAsStream())
0 0
- ServletContext
- ServletContext
- servletcontext
- servletContext
- servletContext
- servletcontext
- ServletContext
- ServletContext
- servletContext
- ServletContext
- ServletContext
- servletContext
- ServletContext
- servletContext
- ServletContext
- servletContext
- ServletContext
- servletcontext
- 深入理解Java虚拟机-学习笔记
- python中的with-as语句学习
- 当你的iPhone收到推送信息后到底会发生什么呢?
- python urllib访问网站
- Linux 查看iptables状态-重启
- ServletContext
- Problem B: C语言习题 字符串比较
- tomcat 7配置精讲
- linux下如何使用sftp命令
- Java--servlet + ThreadLocal解决多线程并发问题及实例
- C++设计模式浅识状态模式
- mac上安装gdb
- RxJava+retrofit2实现网络请求
- 三维建模