servletContext,servletConfig
来源:互联网 发布:大量淘宝小号实名认证 编辑:程序博客网 时间:2024/06/06 00:42
ServletConfig对象用于配置初始化参数,在servlet标签下进行配置
- String getServletName() 获取配置文件中servlet的名称
- String getInitParameter(String name) 获取初始化参数
- Enumeration getInitParameterNames() 获取初始化参数的名称们
ServletContext对象(域对象)
WEB容器在启动时,它会为每个WEB应用程序都创建一个对应的ServletContext对象,它代表当前web应用。
一个WEB应用对应一个ServletContext对象
一个WEB应用下有多个Servlet程序
用于获取WEB应用全局初始化参数
在web.xml中context-param标签下进行配置
String getInitParameter(String name)
getInitParameterNames()
* 实现数据的共享 void setAttribute(String name, Object object) 存入数据 void removeAttribute(String name) 删除数据 Object getAttribute(String name) 获取数据* 读取资源文件 InputStream getResourceAsStream(String path) 通过文件的地址获取输入流 String getRealPath(String path) 通过文件的地址获取文件的绝对磁盘路径
0 0
- ServletConfig ServletContext
- ServletConfig&ServletContext
- servletContext,servletConfig
- ServletContext与ServletConfig分析
- servletcontext 与 servletconfig 分析
- ServletContext与ServletConfig
- ServletContext和servletconfig区别
- ServletContext与ServletConfig
- ServletContext和ServletConfig分析
- 理解ServletContext与ServletConfig
- ServletContext,ServletConfig和Sesion
- ServletConfig与ServletContext
- ServletConfig和ServletContext
- ServletContext与ServletConfig
- servletContext与servletConfig
- ServletConfig和ServletContext
- ServletConfig和ServletContext
- ServletConfig和ServletContext
- 正则表达式
- 中国哲学简史
- 学习笔记之Qt4的2D绘图
- SQL的NEWID
- VS工程垃圾清理工具
- servletContext,servletConfig
- 切片工具:图像缩小到某级别后,部分图像缺失问题的解决
- 运算符的运算顺序
- Hadoop学习笔记—12.MapReduce中的常见算法
- IOS iPhone使用Shadowsocks免越狱教程
- java逻辑运算
- 实用的Window 尺寸 JavaScript 方案(涵盖所有浏览器)
- java新生代 与老生代
- C#调用HTTP接口