配置说明:

web.xml 中配置

<resource-ref>
<description>Employees Database for HR Applications</description>
<res-ref-name>jdbc/EmployeeDB</res-ref-name>
<res-ref-type>javax.sql.DataSource</res-ref-type>
<res-auth>Container</res-auth>
</resource-ref>
res-ref-name/
res-env-ref-name

资源的名称,相对于java:comp/env context

  

对应的jabc连接池配置文件:

tomcat\conf\Catalina\localhost\employer.xml

<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="E:\tomcat\webapps\test" path="/test" reloadable="true">
<Resource name="jdbc/EmployeeDB"
auth="Container"
type="javax.sql.DataSource"
maxActive="1000"
maxIdle="30"
maxWait="100"
username="root"
password="root"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/test?useUnicode=true"/>
</Context>

  

web.xml 中 resource-ref 的注意事项的更多相关文章

  1. Web.xml中自动扫描Spring的配置文件及resource时classpath*:与classpath:的区别

    Web.xml中自动扫描Spring的配置文件及resource时classpath*:与classpath:的区别 一.Web.xml中自动扫描Spring的配置文件(applicationCont ...

  2. SpringMVC(十六):如何使用编程方式替代/WEB-INF/web.xml中的配置信息

    在构建springmvc+mybatis项目时,更常用的方式是采用web.xml来配置,而且一般情况下会在web.xml中使用ContextLoaderListener加载applicationCon ...

  3. servlet中用注解的方式读取web.xml中的配置信息

    在学习servletContext的时候,我们知道了可以在web.xml中通过<context-param>标签来定义全局的属性(所有servlet都能读取的信息),并在servlet中通 ...

  4. Tomcat web.xml中定义了文件扩展名到MIME类型的对应关系

    Tomcat在返回静态资源时,会根据资源文件的扩展名产生对应的content-type头(也即MIME类型)添加到response header中. 在Tomcat的web.xml规定了扩展名及相应M ...

  5. web.xml中contextConfigLocation的作用(转)

    原文地址:http://blog.csdn.net/zhangliao613/article/details/6289114 原文格式较乱,此处略作整理.内容未变. 在web.xml中使用contex ...

  6. 160715、在web.xml中注册IntrospectorCleanupListener解决Quartz等框架可能产生的内存泄露问题

    增加方式如下:web.xml中加入  <listener>    <listener-class>org.springframework.web.util.Introspect ...

  7. Jsp在Web.xml中的配置

    以下列出web.xml经常使用的标签元素及这些标签元素的功能: 1.指定欢迎页面.比如: <welcome-file-list> <welcome-file-list> < ...

  8. web.xml中classpath*:与classpath:的区别

    classpath对应src目录,该目录下的文件会在编译后被存放到WEB-INF文件夹下的classes目录. classpath:只会到你的class路径中查找配置文件,对于多个同名的配置文件,只会 ...

  9. 使用框架时,在web.xml中配置servlet时,拦截请求/和/*的区别。

    关于servlet的拦截设置,之前看了好多,说的都不太清除,明白. 最近明白了一些,总的来说就是保证拦截所有用户请求的同时,放行静态资源. 现整理如下: 一.我们都知道在基于Spring的Applic ...

随机推荐

  1. 每次移1px的无缝轮播图

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. svn提交的时候提示No space left on device

    看到这个错误,第一个反应是磁盘空间满了:但 df 一看,每个分区的空间都还富余的很.从 munin 的监控图表上看 Filesystem usage 也很平稳,但下面的 Inode usage 就有问 ...

  3. HDU 6003 Problem Buyer【小根堆】

    任意k个都可以,也可以看做把不行的都选了,再随便选一个可以的要选的数量 把区间和m个值都排序,区间按l一序r二序排,枚举m个值,小根堆维护能帮韩当前枚举值的区间的右端点,这样方便删除区间,然后剩下的就 ...

  4. Codevs 1159 最大全0子矩阵

    1159 最大全0子矩阵  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 黄金 Gold 题解       题目描述 Description 在一个0,1方阵中找出其中最大的全 ...

  5. Fiddler设置断点修改Request和Response【转】

    Fiddler设置断点修改Request和Response 设置断点的两种方式:工具栏和命令 1.工具栏:Rules -> Automatic Breakpoints(automatic [ɔː ...

  6. eosiolib文件解析

    Source base on EOS version: 1.0.5,some photo except.   在eos源码中,eosiolib库在源码中的位置如下: 在\eos\contracts\e ...

  7. C 语言实例 - 判断数字为几位数

    C 语言实例 - 判断数字为几位数 用户输入数字,判断该数字是几位数. 实例 #include <stdio.h> int main() { long long n; ; printf(& ...

  8. [Java]ArrayList、LinkedList、Vector、Stack的比较

    一.介绍 先回顾一下List的框架图 由图中的继承关系,可以知道,ArrayList.LinkedList.Vector.Stack都是List的四个实现类. AbstractList是一个抽象类,它 ...

  9. Vnc在Ubuntu14.04上的安装和配置 安装:

    安装: Ubuntu14.04 : sudo apt-get install vnc4server : sudo apt-get install xrdp iPad : 安装 vnc viewer 或 ...

  10. react-dnd

    http://react-trello-board.web-pal.com/ https://react-dnd.github.io/react-dnd/docs-tutorial.html http ...