Académique Documents
Professionnel Documents
Culture Documents
By,
www.JAVA9S.com Srinivas Reddy.S
Interceptors
• Separates the cross cutting concerns
• Pre Processing and Post processing.
• Manages the work flow.
www.JAVA9S.com
www.JAVA9S.com
Interceptor By Example
• A Login page
www.JAVA9S.com
Interceptor by Example
• Redisplay the login page for wrong credentials
www.JAVA9S.com
Creating an Interceptor
www.JAVA9S.com
Interceptors in defaultstack
<interceptor-ref name="scopedModelDriven"/>An interceptor that enables
scoped model-driven actions.
<interceptor-ref name="modelDriven"/>Watches for ModelDriven actions
and adds the action's model on to the value stack
<interceptor-ref name="fileUpload"/>Helps in file upload.
<interceptor-ref name="checkbox"/>Looks for a hidden identification field
that specifies the original value of the checkbox.
<interceptor-ref name="staticParams"/>This interceptor populates the
action with the static parameters defined in the action configuration.
<interceptor-ref name="params">This interceptor sets all parameters on
the value stack
<param name="excludeParams">dojo\..*</param>
</interceptor-ref>
www.JAVA9S.com
Interceptors in defaultstack
<interceptor-ref name="conversionError"/> ConversionErrorInterceptor
adds conversion errors from the ActionContext to the Action's field errors.
<interceptor-ref name="validation">Validates the parameters
<param name="excludeMethods">input,back,cancel,browse</param>
</interceptor-ref>
<interceptor-ref name="workflow"> An interceptor that does some basic
validation workflow before allowing the interceptor chain to continue
<param name="excludeMethods">input,back,cancel,browse</param>
</interceptor-ref>
</interceptor-stack>
www.JAVA9S.com
Thank you
Download PPT and example code from
http://java9s.com