Tuesday, May 15, 2007

Webwork ScopeInterceptor

ScopeInterceptor is used to pull attributes out of session/applicaton and set action properties, i.e., dependency injection.

<action name="handleGeneralError" class="...">
<interceptor-ref name="scope">
<param name="key">FoglightError_</param>
<param name="session">exception,statusCode,originalRequestUri</param>
<param name="type">end</param>
<result .../>

key - key prefix
session - a list of action properties to be bound to session scope
type - 'end' means remove from session after action run; 'start' means it's a start action of the wizard-like action sequence and all session scoped properties are reset to their defaults; any other value or no value means that it's in-the-middle action that is set with session properties before it's executed, and it's properties are put back to session after execution.

No comments: