Java Reference
In-Depth Information
} catch (CreateException ex) {
throw new RuntimeException(ex);
} catch (RemoteException ex) {
throw new RuntimeException(ex);
}
}
}
Now everything needs to be wired up in the Spring configuration file shown in List-
ing 4-14. Note that the business delegate is injected into the page controller by the Spring
container.
Listing 4-14.
insurance-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="
http://www.springframework.org/schema/beans"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
xmlns:jee="
http://www.springframework.org/schema/jee"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
<!—other beans - ->
<bean name="/createPolicy.do"
class="com.apress.insuranceapp.web.controller.CreatePolicyController">
<property name="uwrBusinessDelegate" ref="uwrBusinessDelegate"/>
</bean>
<bean name="uwrBusinessDelegate"
class="com.apress.insurance.view.delegate.
å
UnderWritingBusinessDelegateImpl">
<property name="uwrRemoteHome" ref="uwrSlsbRemoteHome" />
</bean>
<bean id="uwrSlsbRemoteHome" class="org.springframework.jndi.
å
JndiObjectFactoryBean">
<property name="jndiName" value="UnderwritingBeanRemote" />
<property name="jndiEnvironment">
<props>
<prop key="java.naming.factory.initial">
org.jnp.interfaces.NamingContextFactory
