ServletContext
来源:互联网 发布:安易数据恢复软件免费 编辑:程序博客网 时间:2024/06/07 02:39
ServletContext
在web.xml 里面配置ServletContext可以实现多个servlet共享:
eg:
<context-param>
<param-name>driver</param-name>
<param-value>com.mysql.jdbc.Driver</param-value>
</context-param>
<context-param>
<param-name>url</param-name>
<param-value>jdbc:mysql://localhost:3306/jdbc</param-value>
</context-param>
在servlet里面可以这样写:
ServletContext sxt = this.getServletContext();
String driver = sxt.getInitParameter("driver");
String url = sxt.getInitParameter(“url");
- ServletContext
- ServletContext
- servletcontext
- servletContext
- servletContext
- servletcontext
- ServletContext
- ServletContext
- servletContext
- ServletContext
- ServletContext
- servletContext
- ServletContext
- servletContext
- ServletContext
- servletContext
- ServletContext
- servletcontext
- sql date类型转换以及date格式的转换
- serial number status
- flex ibatis java 通过sql语句进行多条件模糊查询。
- Android Lint简介
- Use ANT and Maven to create executable jar with dependent library
- ServletContext
- Oracle11g的安装和基本使用
- mysql删除地址栏所指定的id
- HTML(XML)转义字符大全
- 走马观花 --- 网络身份认证协议Kerberos (一)
- BBS项目笔记之三:前台带分类的搜索框
- Gallery和GridView 小结
- 小车的移动的测试程序
- 类