jndi中在web.xml中配置的说明

来源:互联网 发布:软件配置管理实施情况 编辑:程序博客网 时间:2024/06/05 11:03
在/WEB-INF/web.xml中定义资源的特性。使用JNDI查找<resource-ref>和<resource-env-ref>元素时,这些特性被返回。对同一资源名称,还必须定义资源参数,这些参数用来配置对象工厂(object factory)以及对象工厂的属性。
例如,web.xml:

jndi中在web.xml中配置的说明jndi中在web.xml中配置的说明jndi中在web.xml中配置的说明jndi中在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><resource-env-ref><resource-env-ref-name>jms/StockQueue</resource-env-ref-name><resource-env-type>javax.jms.Queue</resource-env-ref-type></resource-env-ref>
jndi中在web.xml中配置的说明jndi中在web.xml中配置的说明jndi中在web.xml中配置的说明jndi中在web.xml中配置的说明

<resource-ref>/<resource-env-ref>元素的有效属性如下:

属性描述res-auth

指定是web应用代码本身sign on到对应的resource mananger,还是由container代表web应用sign on到resource manager。该属性的值必须是Application或者Container。如果在web application deployment descriptor中使用<resource-ref>,这个属性是必需的,如果使用<resource-env-ref>,这个属性是可选的。

description

资源的文字描述(可选)