Java Reference
In-Depth Information
In the previous few sections, I have tried to alter and extend the workflow of the throw-
away controller. In case you are interested, to further enhance this workflow to add more
functionality such as validation, look at extending the ValidatableThrowawayController and
its corresponding handler adapter ValidatableThrowawayControllerHandlerAdapter .
Consequences
Benefits
Improved reusability : Context objects are free from dependencies on any particular
protocol.
Support variety of clients : The lack of dependency on any particular protocol
makes it easy to support different clients with the same codebase.
Easy to test : Without protocol dependency, the page controllers are easily testable
because you can run the tests outside the container and without any servlet-
related objects.
Concerns
Performance consideration : Mapping HTML form field values on to form bean
properties is done using reflection. This may degrade performance.
Hard to maintain : Using form beans along with page controllers increases the
number of classes that have to be maintained.
Intercepting Filter
Problem
The JSP controller presented at the beginning of this chapter performed an authorization
check before actually executing an action in the if-else block. However, since the
eInsure application had multiple controllers, this code was duplicated in all of them.
It would be useful if this code were extracted in a common component and applied
declaratively, transparent to the controller. This would enhance the application's
 
Search WWH ::




Custom Search