Java Reference
In-Depth Information
<bean name="underwritingBusinessDelegate"
<property name="underWritingHome" ref="uwrSlsbHome" />
<bean name="uwrSlsbHome"
<property name="jndiName" value="uwrbusinessslsb" />
<property name="jndiEnvironment">
<prop key="java.naming.factory.initial">
<prop key="java.naming.provider.url">
You can use Spring's property placeholder feature to further externalize the
configuration. In this strategy, you replace the values of the different properties with
placeholders. Then you move the values to an external properties file. It is easy to change
the environment-specific values in the properties file and still keep the Spring XML con-
figuration unaffected. For a detailed treatment of Spring's property placeholder support,
you can refer to
beans.html#beans-factory-placeholderconfigurer .
So, with the Spring Framework, it is possible to set up a configurable service locator
in no time.
Now to support a different application server, you just need to alter the configuration
file. The code shown in Listing 4-4 makes it possible to look up the same EJB deployed on
a JBoss server.
Listing 4-4. insurance-servlet.xml for JBoss
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns=""
Search WWH ::

Custom Search