从 Coldfusion 访问 JRUN jndi 环境变量 (java)
我想在 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>[email protected]</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 目录)中。
I want to put some instance specific configuration information in JNDI. I looked at the information here:
http://www.adobe.com/support/jrun/working_jrun/jrun4_jndi_and_j2ee_enc/jrun4_jndi_and_j2ee_enc03.html
I have added this node to the web.xml:
<env-entry>
<description>Administrator e-mail address</description>
<env-entry-name>adminemail</env-entry-name>
<env-entry-value>[email protected]</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
In coldfusion I have tried several different approaches to querying the data:
<cfset ctx = createobject("java","javax.naming.InitialContext") >
<cfset val = ctx.lookup("java:comp/env") >
That lookup returns a jrun.naming.JRunNamingContext. If i preform a lookup on ctx for the specific binding I am adding I get an error.
<cfset val = ctx.lookup("java:comp/env/adminemail") >
No such binding: adminemail
Preforming a listBindings returns an empty jrun.naming.JRunNamingEnumeration.
<cfset val = ctx.listBindings("java:comp/env") >
I only want to put a string value (probably several) into the ENC (or any JNDI directory at this point).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从未使用过它,但我很好奇,所以我决定尝试一下……但没有成功。
我发现了这个,希望对你有帮助。
http://www.adobe.com/livedocs/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00001570.htm
Never used it, but I got curious so I decided to try ... with no success.
I found this though, hopefully it helps you.
http://www.adobe.com/livedocs/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00001570.htm