net.smartlab.web
Class Action

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by net.smartlab.web.Action
Direct Known Subclasses:
DynaAction

public abstract class Action
extends org.apache.struts.action.Action

This class represents the controller part of the MVC pattern. Extend this class to provide a specific set of operations to be performed in response of a user selection.

Author:
rlogiacco
See Also:
Action

Field Summary
static org.apache.struts.action.ActionForward DEFAULT_FORWARD
          Identifies the default resource the request will be forwarded.
protected  org.apache.commons.logging.Log logger
          Provides logging capabilities to the action.
 
Fields inherited from class org.apache.struts.action.Action
servlet
 
Constructor Summary
Action()
           
 
Method Summary
protected  void addError(org.apache.struts.action.ActionMessage message, javax.servlet.http.HttpServletRequest request)
          TODO documentation
protected  void addError(java.lang.String property, org.apache.struts.action.ActionMessage message, javax.servlet.http.HttpServletRequest request)
          TODO documentation
protected  org.apache.struts.action.ActionForward cancel(org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionMapping mapping)
          Describes the operations sequence to be performed upon cancellation of a form or wizard returning the mapping to redirect to.
protected abstract  org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionMapping mapping)
          Implement this method to provide a custom response to a user input.
 org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          This method performs some common operations then redirects control to the abstract execute.
protected  java.util.Properties getProperties()
          TODO documentation
protected  java.lang.String getRealPath(java.lang.String path)
          TODO documentation
protected  javax.servlet.ServletContext getServletContext()
          TODO documentation
protected  boolean hasErrors(javax.servlet.http.HttpServletRequest request)
          TODO documentation
 boolean isChecked(java.lang.String name, javax.servlet.http.HttpServletRequest request)
          TODO documentation
protected  void populate(org.apache.struts.action.ActionForm form, java.lang.Object bean, java.util.Locale locale)
          Populates, or prevalorizes, an html form with the values of a bean instance .
 void reset(org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, org.apache.struts.action.ActionMapping mapping)
          Ensures the specified html form has all its fields resetted to their initial value.
protected  void valorize(org.apache.struts.action.ActionForm form, java.lang.Object bean, java.util.Locale locale)
          Valorizes a bean instance with the values providen with the user submitted html form.
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FORWARD

public static final org.apache.struts.action.ActionForward DEFAULT_FORWARD
Identifies the default resource the request will be forwarded.


logger

protected final org.apache.commons.logging.Log logger
Provides logging capabilities to the action.

Constructor Detail

Action

public Action()
Method Detail

execute

public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)
                                               throws java.lang.Exception
This method performs some common operations then redirects control to the abstract execute.

Overrides:
execute in class org.apache.struts.action.Action
Throws:
java.lang.Exception
See Also:
Action.execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

execute

protected abstract org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionForm form,
                                                                  javax.servlet.http.HttpServletRequest request,
                                                                  javax.servlet.http.HttpServletResponse response,
                                                                  org.apache.struts.action.ActionMapping mapping)
                                                           throws java.lang.Exception
Implement this method to provide a custom response to a user input.

Parameters:
form - the html form submitted with this request.
request - the user request.
response - the representation of the response channel.
mapping - the system control mapping.
Returns:
the name of a defined global or local forward.
Throws:
java.lang.Exception - if something unexpected happend during the request execution.

cancel

protected org.apache.struts.action.ActionForward cancel(org.apache.struts.action.ActionForm form,
                                                        javax.servlet.http.HttpServletRequest request,
                                                        javax.servlet.http.HttpServletResponse response,
                                                        org.apache.struts.action.ActionMapping mapping)
                                                 throws java.lang.Exception
Describes the operations sequence to be performed upon cancellation of a form or wizard returning the mapping to redirect to. By default this method simply does nothing more than redirecting to the input path.

Parameters:
form - the html form submitted with this request.
request - the user request.
response - the representation of the response channel.
mapping - the system control mapping.
Returns:
the name of a defined global or local forward.
Throws:
java.lang.Exception - if something unexpected happend during the request execution.

valorize

protected void valorize(org.apache.struts.action.ActionForm form,
                        java.lang.Object bean,
                        java.util.Locale locale)
                 throws ActionException
Valorizes a bean instance with the values providen with the user submitted html form. This method uses an improved version of the introspection paradigm to discover properties bindings.

Parameters:
form - the user submitted html form containing the values to be read.
bean - the bean instance to be valorized.
locale - the user locale for values parsing.
Throws:
ActionException - if the valorization fails, usually due to inconsistencies between the bean and the submitted form.

populate

protected void populate(org.apache.struts.action.ActionForm form,
                        java.lang.Object bean,
                        java.util.Locale locale)
                 throws ActionException
Populates, or prevalorizes, an html form with the values of a bean instance . This method uses an improved version of the introspection paradigm to discover properties bindings.

Parameters:
form - the form to be populated.
bean - the bean instance containing the values to be written in the form.
locale - the user locale for values parsing.
Throws:
ActionException - if the valorization fails, usually due to inconsistencies between the bean and the submitted form.

reset

public void reset(org.apache.struts.action.ActionForm form,
                  javax.servlet.http.HttpServletRequest request,
                  org.apache.struts.action.ActionMapping mapping)
Ensures the specified html form has all its fields resetted to their initial value.

Parameters:
form - the form to be cleaned up.
request - the user request.
mapping - the system control mapping.

hasErrors

protected boolean hasErrors(javax.servlet.http.HttpServletRequest request)
TODO documentation

Parameters:
request -
Returns:

addError

protected void addError(org.apache.struts.action.ActionMessage message,
                        javax.servlet.http.HttpServletRequest request)
TODO documentation

Parameters:
message -
request -

addError

protected void addError(java.lang.String property,
                        org.apache.struts.action.ActionMessage message,
                        javax.servlet.http.HttpServletRequest request)
TODO documentation

Parameters:
property -
message -
request -

isChecked

public boolean isChecked(java.lang.String name,
                         javax.servlet.http.HttpServletRequest request)
TODO documentation

Parameters:
name -
request -
Returns:

getServletContext

protected javax.servlet.ServletContext getServletContext()
TODO documentation

Returns:

getRealPath

protected java.lang.String getRealPath(java.lang.String path)
TODO documentation

Parameters:
path -
Returns:

getProperties

protected java.util.Properties getProperties()
TODO documentation

Returns:


Copyright © 2004-2009 The SmartWeb Team. All Rights Reserved.