简体   繁体   English

JNDI InitialContext-服务器路径

[英]JNDI InitialContext - Server Path

I am struggling to understand what InitialContext does. 我正在努力了解InitialContext的作用。 I understand that it provides initial context to lookup objects, but which server does it lookup? 我了解它为查询对象提供了初始上下文,但是查询对象是哪台服务器?

I know that we can pass the server url as one of the properties for Context, but "generally" the InitialContext is called without parameters. 我知道我们可以将服务器url作为Context的属性之一传递,但是“通常”调用InitialContext时不带参数。 In that "general" case which server it does lookup? 在那种“一般”情况下,它在哪个服务器上查找?

If you are constructing the InitialContext from within a application which is hosted in a server (web/app servers), then it defaults to the Initial Context and the port of the hosted server. 如果要从服务器(Web /应用程序服务器)中托管的应用程序内部构造InitialContext,则默认为Initial Context和托管服务器的端口。

In order words, your lookup object is also bound to the JNDI tree of the server that your calling application is deployed. 换句话说,您的查找对象还绑定到部署了调用应用程序的服务器的JNDI树。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM