JNDI InitialContext null 构造函数的行为如何?
How does the JNDI InitialContext null constructor behave ?
我看到了一个关于 JNDI 问题的 Whosebug 回答。
答案显示了使用 InitialContext 检索数据源的几行代码。
但是,创建的 InitialContext 实例没有任何属性来使用任何类型的服务,例如 LDAP 或文件系统。
当您使用 null 构造函数将条目绑定到 InitialContext 时,条目会去哪里?
该条目是否仅在应用程序内可见?
当您关闭应用程序时,它不会持续存在吗?
Where does the entry go when you bind it to an InitialContext with the null constructor?
如果有一个名为 /jndi.properties
的资源文件,它会使用其中定义的任何环境。 Servlet 容器通常使用它来为 java:
命名空间定义一个额外的对象工厂。
Will the entry only [be] visible within the application?
是的。
Will it not persist when you shutdown the application?
除非容器实现它,否则它不会持续存在。
我看到了一个关于 JNDI 问题的 Whosebug 回答。
答案显示了使用 InitialContext 检索数据源的几行代码。
但是,创建的 InitialContext 实例没有任何属性来使用任何类型的服务,例如 LDAP 或文件系统。
当您使用 null 构造函数将条目绑定到 InitialContext 时,条目会去哪里?
该条目是否仅在应用程序内可见?
当您关闭应用程序时,它不会持续存在吗?
Where does the entry go when you bind it to an InitialContext with the null constructor?
如果有一个名为 /jndi.properties
的资源文件,它会使用其中定义的任何环境。 Servlet 容器通常使用它来为 java:
命名空间定义一个额外的对象工厂。
Will the entry only [be] visible within the application?
是的。
Will it not persist when you shutdown the application?
除非容器实现它,否则它不会持续存在。