Java Reference
In-Depth Information
<property name="uwrBusinessService"
ref="uwrBusinessServiceProxy" />
<property name="formView"
value="createPolicy" />
<property name="commandName"
value="policydetails" />
<property name="successView"
value="policydetails" />
<property name="commandClass"
value="com.apress.insuranceapp.web.formbean.PolicyFormBean" />
</bean>
</beans>
You may be thinking that because the business delegate is no longer there, the page
controller will be tightly coupled with the EJBs and need to handle
RemoteException
. How-
ever, this task is handled by the
SimpleRemoteStatelessSessionProxyFactoryBean
class. It
will intercept any
RemoteException
raised by the EJBs and convert it to Spring's unchecked
RemoteAccessException
.
Business interfaces work best with local SLSBs as well. In this case, you need not
define any extra interface. You can very well use the interface defined by the application
service because the local EJBs are not required to throw
RemoteException
. Another differ-
ence is that in the case of local EJBs, you need to use
LocalStatelessSessionProxy
å
FactoryBean
as the proxy service locator. Listing 4-30 shows the use of this service locator.
Listing 4-30.
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
