Class BeanDerivedAction
java.lang.Object
com.zfabrik.util.microweb.actions.BeanDerivedAction
- All Implemented Interfaces:
IAction
-
Constructor Summary
ConstructorDescriptionBeanDerivedAction(Class<?> beanClz, Object... initParams)
A bean derived action is exactly that: An action derived from a simple Java Bean. -
Method Summary
-
Constructor Details
-
BeanDerivedAction
A bean derived action is exactly that: An action derived from a simple Java Bean. In short, all Java Bean setters will receive request attributes and request parameters (in that order), while all getters translate to request attributes after invocation of the action method.
Action methods are identified by the prefix of "do" and the action name with a capitalized first letter. For example "doBookJourney" for an action "bookJourney" or "BookJourney". The following signatures are valid for action methods:- OutCome do<Action>();
- OutCome do<Action>(? extends
HttpServletRequest
); - OutCome do<Action>(? extends
HttpServletRequest
,? extendsHttpServletResponse
); - OutCome do<Action>(? extends
ServletContext
, ? extendsHttpServletRequest
); - OutCome do<Action>(? extends
ServletContext
, ? extendsHttpServletRequest
,? extendsHttpServletResponse
);
Before invoking any action but after applying request parameters, an init method will be called, if existing. If that method returns a non-null outcome, no action will be called. Any valid action method signature is also a valid init method signature.- Parameters:
beanClz
-
-
-
Method Details
-
handle
public OutCome handle(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws javax.servlet.ServletException, IOException- Specified by:
handle
in interfaceIAction
- Throws:
javax.servlet.ServletException
IOException
-