How to use JndiPropertySource?

We are trying to convert our WebApp to a complete configuration using JndiPropertySource(for all environment-specific options).

Does anyone have an example of using this (maybe even for tomcat)?

We already get DataSourcethrough JNDI, so we want it to HibernateDialectbe configured directly, except for it ...

+3
source share
1 answer

In yours spring-context.xmlyou only need the placeholder tag:

<context:property-placeholder />

After that, you insert the environment tag into the main Tomcats file context.xml, it reads it:

<Environment name="hibernate.dialect" 
            value="org.hibernate.dialect.Oracle10gDialect" 
             type="java.lang.String" 
         override="false"/>

Now you can use the code ${hibernate.dialect}in the sprinng configuration file.

+2
source

All Articles