Class BeanDerivedAction

java.lang.Object
com.zfabrik.util.microweb.actions.BeanDerivedAction
All Implemented Interfaces:
IAction

public class BeanDerivedAction extends Object implements IAction
  • Constructor Summary

    Constructors
    Constructor
    Description
    BeanDerivedAction​(Class<?> beanClz, Object... initParams)
    A bean derived action is exactly that: An action derived from a simple Java Bean.
  • Method Summary

    Modifier and Type
    Method
    Description
    handle​(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BeanDerivedAction

      public BeanDerivedAction(Class<?> beanClz, Object... initParams)
      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,? extends HttpServletResponse);
      • OutCome do<Action>(? extends ServletContext, ? extends HttpServletRequest);
      • OutCome do<Action>(? extends ServletContext, ? extends HttpServletRequest,? extends HttpServletResponse);
      One or more actions may be called during a request. Every parameter classifies as an action as long as their is a matching action method.
      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 interface IAction
      Throws:
      javax.servlet.ServletException
      IOException