org.infohazard.maverick.ctl
Class ThrowawayBean

java.lang.Object
  |
  +--org.infohazard.maverick.ctl.Throwaway
        |
        +--org.infohazard.maverick.ctl.ThrowawayBean
All Implemented Interfaces:
Controller

public class ThrowawayBean
extends Throwaway

Note: While not formally deprecated, use of this class is discouraged. You should use ThrowawayBean2 instead. ThrowawayBean is a throwaway controller which populates its bean properties using the Apache BeanUtils. Note that the default implementation of model() returns "this".


Field Summary
 
Fields inherited from class org.infohazard.maverick.ctl.Throwaway
ERROR, SUCCESS
 
Constructor Summary
ThrowawayBean()
           
 
Method Summary
 java.lang.Object model()
          Default implementation returns "this".
protected  java.lang.String perform()
          This is the method you should override to implement application logic.
protected  java.lang.String rawPerform()
          This is the method you should override to implement application logic.
 
Methods inherited from class org.infohazard.maverick.ctl.Throwaway
getCtx, getRequest, getResponse, getServletConfig, getServletContext, getSession, go
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThrowawayBean

public ThrowawayBean()
Method Detail

perform

protected java.lang.String perform()
                            throws java.lang.Exception
This is the method you should override to implement application logic. Default implementation just returns "success".

java.lang.Exception

model

public java.lang.Object model()

Default implementation returns "this". This is the typical use case of html form processing; the controller itself will have setters and getters for the various fields. See the FriendBook sample for several examples of this idiom.

It's certainly not necessary to use the controller-as-model pattern. You can return specific objects to custom-tailor the "shape" of the model.

Specified by:
model in class Throwaway
See Also:
org.infohazard.maverick.flow.Controller.Result#model

rawPerform

protected final java.lang.String rawPerform()
                                     throws java.lang.Exception
Description copied from class: Throwaway
This is the method you should override to implement application logic.

Specified by:
rawPerform in class Throwaway
java.lang.Exception