servletconfig和servlcontext的作用和使用
来源:互联网 发布:io流 java面试题 编辑:程序博客网 时间:2024/06/04 20:02
一、ServletConfig对象
首先,需要创建私有变量:private ServletConfig config = null;
其次,要重写init方法,传入config,令this.config = config;从而获得ServletConfig对象
最后,就可以获得<init-parm>中的配置信息了
//获取初始化参数
//获得配置文档中<init-param>标签下name对应的value
1)获得字符集编码
2)获得数据库连接信息
3)获得配置文件
二、ServletContext对象
在serlvet中,可以使用如下语句来设置数据共享
在另一个servlet中,可以使用如下语句来获取域中的data属性
由于servlet中的Java数据不易设置样式,所以serlvet可以将java数据转发到JSP页面中进行处理
- servletconfig和servlcontext的作用和使用
- ServletConfig和ServletContext对象的作用和使用
- ServletConfig和ServletContext的使用
- java_web学习第二天(ServletConfig和ServletContext对象的作用和使用)
- ServletConfig和ServletContext的简单使用
- Servlet概述以及ServletConfig 和ServletContext对象的作用
- ServletConfig和ServletContext的区别
- ServletConfig和ServletContext的区别
- ServletContext和ServletConfig的区别
- ServletContext和ServletConfig的理解
- ServletConfig和ServletContext的区别
- ServletConfig和ServletContext的区别
- ServletConfig和ServletContext的意思
- Servlet的生命周期和ServletConfig
- ServletConfig和ServletContext的意思
- ServletConfig和ServletConfig参数访问
- servletconfig的作用
- servletconfig的作用
- iOS编程学习九
- Servlet菜鸟教程
- 《java设计模式》之责任链模式
- BZOJ 1941: [Sdoi2010]Hide and Seek kdtree
- redis基本命令
- servletconfig和servlcontext的作用和使用
- 剑指offer——丑数
- Objective-C语言入门教程I(视频)
- 对象
- java工程远程Linux服务器上的Mysql
- guava cache 使用
- StyleSheet
- 单例模式八种写法比较 2017-07-04 15:30 25人阅读 评论(0) 收藏 举报 分类: Android移动互联(19) 版权声明:本文为博主原创文章,未经博主允许不得转载。 目录
- Java Design Demo -简单的队列-异步多任务队列(java android)