...
Aside from actions and results, you we can also specify exception handlers and interceptors.
- Exception handlers declare how to handle an exception on a global or local basis. Instead of sprinking source code with try .. catch blocks, we can let the framework can catch the exception display the page of our choice. The page can display an appropriate message and details from the exception.
- Interceptors specify the "request-processing lifecycle" for an action. (What happens to the request before and after the Action class fires.)
...
- We can specify both global and local lifecycles. If some
...
- actions respond to AJAX, SOAP, or JSF requests,
...
- we can simplify the lifecycle, and even just "pass through" the request, if
...
- need be. However, these are special cases, and most applications can use the default interceptor stac, "out of the box".
The diagram describes the framework's architecture.
...
Note |
---|
All objects in this architecture (Action, Result, Interceptor, and so forth) are created by an ObjectFactory. This ObjectFactory is pluggable. You We can also provide your our own ObjectFactory for any reason that requires knowing when objects in the framework are created. The default ObjectgFactory ObjectFactory is Spring. |
Finally, the Interceptors are executed again (in reverse order, calling the after method). Finally, the response returns through the filters configured in the web.xml
. If the ActionContextCleanUp filter is present, the FilterDispatcher will not clean up the ThreadLocal ActionContext. If the ActionContextCleanUp filter is not present, the FilterDispatcher will cleanup all ThreadLocals.
...