Expresso 5-6

com.jcorporate.expresso.core.controller
Class DefaultForm

java.lang.Object
  extended byorg.apache.struts.action.ActionForm
      extended bycom.jcorporate.expresso.core.controller.DefaultForm
All Implemented Interfaces:
Serializable, StateForm
Direct Known Subclasses:
ControllerForm

public class DefaultForm
extends org.apache.struts.action.ActionForm
implements Serializable, StateForm

*

This class is a bridge between Expresso's Controller system and the Struts Action Form. It is automatically utilized by Expresso and you don't have to directly deal with it.

Since:
Expresso 4.0
Author:
Michael Nash
See Also:
Serialized Form

Field Summary
protected  int page
           
protected  org.apache.commons.validator.ValidatorResults validatorResults
           
 
Fields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet
 
Constructor Summary
DefaultForm()
           
 
Method Summary
 void clear()
           
 Object getAttribute(String fieldName)
          Returns the attribute that has been set for a particular field OR null if it doesn't exist.
 Hashtable getAttributes()
          Returns the attributes Hashtable.
 String getField(String fieldName)
           
 Hashtable getFields()
           
 org.apache.commons.validator.Validator initValidator(String key, Object bean, ServletContext application, HttpServletRequest request, org.apache.struts.action.ActionErrors errors, int page)
           
 void restoreForm(ControllerRequest req)
           
 void saveForm(ControllerRequest req)
           
 void setAttribute(String fieldName, Object newValue)
           
 void setField(String fieldName, String fieldValue)
           
 void setUsingHashtableParameters(Hashtable parameters)
           
 org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping, HttpServletRequest request)
           
 org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping, ServletRequest request)
           
 ErrorCollection validate(ControllerRequest request)
           
 
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, reset, reset, setMultipartRequestHandler, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

page

protected int page

validatorResults

protected org.apache.commons.validator.ValidatorResults validatorResults
Constructor Detail

DefaultForm

public DefaultForm()
Method Detail

validate

public org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping,
                                                      ServletRequest request)

saveForm

public void saveForm(ControllerRequest req)
              throws ControllerException
Throws:
ControllerException

restoreForm

public void restoreForm(ControllerRequest req)
                 throws ControllerException
Throws:
ControllerException

getFields

public Hashtable getFields()

clear

public void clear()

setAttribute

public void setAttribute(String fieldName,
                         Object newValue)

setField

public void setField(String fieldName,
                     String fieldValue)
              throws ControllerException
Throws:
ControllerException

setUsingHashtableParameters

public void setUsingHashtableParameters(Hashtable parameters)
                                 throws ControllerException
Throws:
ControllerException

getAttribute

public Object getAttribute(String fieldName)
                    throws ControllerException
Returns the attribute that has been set for a particular field OR null if it doesn't exist.

Throws:
ControllerException - if fieldName is blank.

getAttributes

public Hashtable getAttributes()
Returns the attributes Hashtable.


getField

public String getField(String fieldName)
                throws ControllerException
Throws:
ControllerException

validate

public org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping,
                                                      HttpServletRequest request)

validate

public ErrorCollection validate(ControllerRequest request)
Specified by:
validate in interface StateForm

initValidator

public org.apache.commons.validator.Validator initValidator(String key,
                                                            Object bean,
                                                            ServletContext application,
                                                            HttpServletRequest request,
                                                            org.apache.struts.action.ActionErrors errors,
                                                            int page)

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.