我想在JNDI中放置一些特定于实例的配置信息。我看了这里的信息:http://www.adobe.com/support/jrun/working_jrun/jrun4_jndi_and_j2ee_enc/jrun4_jndi_and_j2ee_enc03.html
我已将此节点添加到web.xml中:
<env-entry>
<description>Administrator e-mail address</description>
<env-entry-name>adminemail</env-entry-name>
<env-entry-value>admin@mystore.com</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>在coldfusion中,我尝试了几种不同的数据查询方法:
<cfset ctx = createobject("java","javax.naming.InitialContext") >
<cfset val = ctx.lookup("java:comp/env") >该查找返回一个jrun.naming.JRunNamingContext。如果我在ctx上为我添加的特定绑定执行查找,我会得到一个错误。
<cfset val = ctx.lookup("java:comp/env/adminemail") >
No such binding: adminemail 执行listBindings将返回一个空的jrun.naming.JRunNamingEnumeration。
<cfset val = ctx.listBindings("java:comp/env") >我只想将一个字符串值(可能有几个)放入ENC (或此时的任何JNDI目录)。
发布于 2010-06-15 03:30:22
从来没有用过,但我很好奇,所以我决定试一试...但没有成功。
我找到了这个,希望它能帮助你。
http://www.adobe.com/livedocs/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00001570.htm
https://stackoverflow.com/questions/2553823
复制相似问题