jodd.madvoc.interceptor
Class PrepareInterceptor

java.lang.Object
  extended by jodd.madvoc.interceptor.ActionInterceptor
      extended by jodd.madvoc.interceptor.PrepareInterceptor

public class PrepareInterceptor
extends ActionInterceptor

Prepares action by calling prepare() before action method invocation.

A typical use of this is to run some logic to load an object from the database, so that when parameters are set they can be set on this object. For example, suppose you have a User object with two properties: id and name. Provided that the params interceptor is called twice (once before and once after this interceptor), you can load the User object using the id property, and then when the second params interceptor is called the parameter user.name will be set, as desired, on the actual object loaded from the database.

See Also:
PrepareAndIdInjectorInterceptor

Field Summary
 
Fields inherited from class jodd.madvoc.interceptor.ActionInterceptor
initialized
 
Constructor Summary
PrepareInterceptor()
           
 
Method Summary
 java.lang.Object intercept(ActionRequest actionRequest)
          Intercepts action requests.
 
Methods inherited from class jodd.madvoc.interceptor.ActionInterceptor
init, initialized, isInitialized, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrepareInterceptor

public PrepareInterceptor()
Method Detail

intercept

public java.lang.Object intercept(ActionRequest actionRequest)
                           throws java.lang.Exception
Intercepts action requests.

Specified by:
intercept in class ActionInterceptor
Throws:
java.lang.Exception


Copyright © 2003-2011 Jodd Team