Setting a property in java: comp / env?

I am writing Java projects with Eclipse and I wonder if there is a way to set a new property in java: comp / env via java? Every help is appreciated!

+4
source share
2 answers

java:comp/env is read-only at runtime, so no .

+2
source

Quote from http://v1.dione.zcu.cz/java/docs/jndi-1.2/tutorial/beyond/misc/policy.html

JNDI does not define a naming policy on its own. However, one important platform that defines a limited set of naming policies for using JNDI is Java 2, Enterprise Edition (J2EETM). It defines a logical namespace that application components (such as Enterprise JavaBeans, servlets, and JavaServer (JSP) pages) can use to denote resources, components, and other data. The namespace is provided to the component by its container, the entity that runs the component. Typically, a component has a deployment descriptor that contains, among other data, information about the logical names and types of resources and components that the component or links need.

If you look only at the last two sentences, I would say that these properties cannot be set programmatically

+1
source

Source: https://habr.com/ru/post/1437371/


All Articles