|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.struts.action.Action
org.davesag.generica.servlet.action.AbstractAction
An abstract Action that any of your actions should extend.
| Field Summary |
| Fields inherited from class org.apache.struts.action.Action |
ACTION_SERVLET_KEY, APPLICATION_KEY, DATA_SOURCE_KEY, defaultLocale, ERROR_KEY, EXCEPTION_KEY, FORM_BEANS_KEY, FORWARDS_KEY, LOCALE_KEY, MAPPING_KEY, MAPPINGS_KEY, MESSAGE_KEY, MESSAGES_KEY, MULTIPART_KEY, PLUG_INS_KEY, REQUEST_PROCESSOR_KEY, servlet, SERVLET_KEY, TRANSACTION_TOKEN_KEY |
| Constructor Summary | |
AbstractAction()
|
|
| Method Summary | |
void |
abortTransaction(Transaction tx)
Aborts the supplied Transaction. |
void |
commitTransaction(Transaction tx)
Commits the supplied Transaction. |
protected void |
furtherActions(Map params,
HttpServletRequest request,
HttpServletResponse response,
ActionForm form)
Perform any additional acts needed to fulfil the goals of your action. |
void |
genericActions(Map params,
HttpServletRequest request,
HttpServletResponse response,
ActionForm form)
Once the action's core controller's are used, look for any generic
Actor or Presenter controllers and their parameters,
and call them in the order we find them. |
ServletContext |
getApplication(HttpSession session)
Returns the ServletContext. |
ActionController |
getController(String controllerclass)
Gets the ActionController to be used by this action. |
ActionController |
getController(String controllerclass,
HttpServletRequest request,
HttpServletResponse response,
ActionForm form)
Gets the ActionController to be used by this action. |
Session |
getHibernateSession(HttpSession session)
Returns the current hibernate session. |
Locale |
getLocale(HttpSession session)
Returns the current active Locale |
MessageResources |
getMessages(HttpServletRequest request)
Exposes the MessageResources to the Controllers
. |
String |
getNextForward(HttpServletRequest request)
What the next 'success' action should be. |
Transaction |
openTransaction(HttpSession session)
Opens a transaction using the HibernateSession for the HttpSession provided. |
protected void |
presentation(Map params,
HttpServletRequest request,
HttpServletResponse response,
ActionForm form)
Prepare any additional presentation data needed by the GUI using any Presenter s derived
from the Map of params supplied. |
protected void |
saveActionErrors(HttpServletRequest request,
ActionErrors errors)
The saveActionErrors method differs from the Action
superclass' saveErrors method in that it also writes a
"true" value to the Constants.ACTION_ERRORS
key in the current request. |
void |
setNextForward(HttpServletRequest request,
String forward)
Tells the action what the next 'success' action should be. |
| Methods inherited from class org.apache.struts.action.Action |
execute, execute, generateToken, getDataSource, getDataSource, getLocale, getResources, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, perform, perform, resetToken, saveErrors, saveMessages, saveToken, setLocale, setServlet, toHex |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AbstractAction()
| Method Detail |
public ActionController getController(String controllerclass)
throws ClassNotFoundException
ActionController to be used by this action.
controllerclass - The fully qualified class name of the
ActionController.
ActionController implemetation.
ClassNotFoundException - if the controllerclass can not be
instantiated.
public ActionController getController(String controllerclass,
HttpServletRequest request,
HttpServletResponse response,
ActionForm form)
throws ClassNotFoundException
ActionController to be used by this action.
controllerclass - The fully qualified class name of the
controller.request - The Servlet Request.response - the http response.form - The Struts Action Form.
ClassNotFoundException - if the controllerclass can not be
instantiated.
protected void saveActionErrors(HttpServletRequest request,
ActionErrors errors)
saveActionErrors method differs from the Action
superclass' saveErrors method in that it also writes a
"true" value to the Constants.ACTION_ERRORS
key in the current request.
request - The servlet request.errors - the ActionErrors to save.
public void setNextForward(HttpServletRequest request,
String forward)
Actor controllers may change that to suit themselves.
request - The request.forward - The forward name.public String getNextForward(HttpServletRequest request)
Actor
controllers may change that to suit themselves.
request - The request.
public ServletContext getApplication(HttpSession session)
ServletContext.
session - the http session.
public MessageResources getMessages(HttpServletRequest request)
MessageResources to the Controllers
. Normally the getResources method is protected and thus
the Controllers can not get to it.
request - The HttpServletRequest.
public Session getHibernateSession(HttpSession session)
throws HibernateException
session - The current HttpSession.
HibernateException - if the Underlying SessionFactory could not
be found. This usually means that the
PersistenceManagementFilter has not
been correctly configured in the
web.xml file.PersistenceManagementFilterpublic Transaction openTransaction(HttpSession session)
session - The HttpSession holding the active Hibernate
SessionFactory.
public void commitTransaction(Transaction tx)
Transaction.
tx - The Transaction to commit.public void abortTransaction(Transaction tx)
Transaction.
tx - The Transaction to commit.
public Locale getLocale(HttpSession session)
throws Exception
Locale
session - the http session.
Exception - if anything went wrong.
protected void furtherActions(Map params,
HttpServletRequest request,
HttpServletResponse response,
ActionForm form)
The actor controllers all take the same set of actor-params so you can link actor and presentation controllers using common param names or values.
params - A map of the Controller class names defined in
struts-config.xml for this action.request - The incoming HttpRequest.response - the http response.form - The ActionForm if any.Actor
protected void presentation(Map params,
HttpServletRequest request,
HttpServletResponse response,
ActionForm form)
Presenter s derived
from the Map of params supplied. Call this
method in your action immediately prior to the end of the execute
method.
The presentation controllers all take the same set of presentation-params so you can link controllers using common presentation param names or values.
params - A map of the Controller class names defined in
struts-config.xml for this action.request - The incoming HttpRequest.response - the http response.form - The ActionForm if any.Presenter
public void genericActions(Map params,
HttpServletRequest request,
HttpServletResponse response,
ActionForm form)
Actor or Presenter controllers and their parameters,
and call them in the order we find them.
params - A map of the Controller class names defined in
struts-config.xml for this action.request - The incoming HttpRequest.response - the http response.form - The ActionForm if any.Presenter,
Actor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||