By using the Business Delegate and Service Locator patterns, we’ve got Rachel’s controllers protected from the complexities of remote model components. Now let’s see if we can do the same for the web designer’s JSPs.
Quick review of the old non-remote way— the JSP uses EL to get info from the local model.
This diagram should look familiar from earlier in the chapter. The JSP gets the bean reference from the request object (step 3), then calls getters on the bean (step 4).
1 Having received a request for customer information, the Controller calls the ManageCustomer model component. The model component does a remote call to the legacy database, then creates a Customer bean, populated with customer data from the database.
2 The Controller adds the Customer reference to the request, as an attribute.
3 The controller forwards to the View JSP. The JSP gets a reference to the Customer bean from the request object.
4 The View JSP uses EL to get the Customer Bean properties it needs to satisfy the original request.