在WebSphere中通过JNDI配置和查找简单的字符串 [英] Configuring and looking up a simple String via JNDI in WebSphere

查看:124
本文介绍了在WebSphere中通过JNDI配置和查找简单的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我们的应用程序的配置,我们希望将一些配置放置在应用程序服务器中.

For the configuration of our applications we want to place some of the configuration in the application server.

我们当前正在使用WebSphere JNDI工具来查找URL和数据源.

We are currently using the WebSphere JNDI facility for looking up urls and datasources.

此外,我们想在应用服务器中放置简单的字符串.我们不想使用WebSphere环境变量".

In addition we want to place simple Strings in the application server. We don't want to use the WebSphere "Enviroment variables".

资源环境"可以用于此目的吗?如果是这样,怎么使用?

Can the "Resource Environment" be used for such a purpose? If so, how can it be used?

我们想要使用以下字符串:

We'd like to get the Strings with:

InitialContext ctx = new InitalContext();
String myString = (String)ctx.lookup("jndi/string/myString");

还有其他更简单的选择吗?

Are there any more simple alternatives?

我们正在使用WebSphere Application Server 7.

We are using WebSphere Application Server 7.

推荐答案

我相信您可以使用

I believe you can use Name Space Bindings for this (under Environment, Naming, Name Space Bindings.)

模糊:

命名空间绑定

使用此页面来配置常量字符串值的名称绑定, 企业bean,CORBA CosNaming命名上下文或CORBA叶 节点对象,或可以使用JNDI查找的对象.

Use this page to configure a name binding of a constant string value, an enterprise bean, a CORBA CosNaming Naming Context or CORBA leaf node object, or an object that can be looked up by using JNDI.

这篇关于在WebSphere中通过JNDI配置和查找简单的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆