This should be in theory really easy but it hasn't been for me so I post of the forum as a last resort.
Problem
Want to be able to set an environment entry in Tomcat context.xml file such as
and then lookup and retrieve this environment entry inside my spring configuration.Code:<Context ...> ... <Environment name="baseRmiUrl" value="rmi://whatever" type="java.lang.String" override="false"/> ... </Context>
I've look at the documentation here which is about as clear as mud to me.
Spring Documentation
Code:Before... <bean id="simple" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="jdbc/MyDataSource"/> <property name="jndiEnvironment"> <props> <prop key="foo">bar</prop> </props> </property> </bean> After... <jee:jndi-lookup id="simple" jndi-name="jdbc/MyDataSource"> <jee:environment>foo=bar</jee:environment> </jee:jndi-lookup>
How do I get the environment entry and turn that into a string property so that I may reference it in a <bean> such as
Code:<bean id="remoteAuthenticationService" parent="baseAuthRemoteServerService"> <property name="serviceUrl"> <value>${baseRmiUrl}/authenticationService</value> </property> <property name="serviceInterface"> <value>com.tangler.service.AuthenticationService</value> </property> </bean>


Reply With Quote
If you post it I will see if it is amenable to adding to the Spring reference documentation as an advanced example in the <jee:jndi-lookup/> section.