com.oroad.stxx.action
Class ActionServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.apache.struts.action.ActionServlet
              extended bycom.oroad.stxx.action.ActionServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ActionServlet
extends org.apache.struts.action.ActionServlet

The replacement Struts 1.0 servlet to enable stxx. This class extends the Struts 1.0 servlet to add stxx features.

Author:
Jeff Pennal, Don Brown
See Also:
Serialized Form

Field Summary
protected static java.lang.String TRANSFORMER_HANDLER_KEY
          Key the transformer handler is stored under in the servlet context
 
Fields inherited from class org.apache.struts.action.ActionServlet
config, configDigester, convertNull, dataSources, debug, internal, internalName, log, processor, registrations, servletMapping, servletName
 
Constructor Summary
ActionServlet()
           
 
Method Summary
protected  void destroyApplication()
          Override the destroyApplication object to destroy the stxx objects
 void init()
          Override the init method to load the init of stxx stuff
protected  Digester initDigester(int detail)
          Override the initDigester of the main struts class to add functionality for supporting transform tags in the tag
protected  void process(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Since I cannot override the process method, I've just copied the contents here.
protected  void processActionForward(ActionForward forward, org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Overrides the struts process ActionForward method to trap for transformation that need to be done.
protected  boolean processValidate(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm formInstance, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Call the validate() method of the specified ActionForm, and forward back to the input form if there are any errors.
 void reload()
          Override the reload method to load the init of stxx stuff
 
Methods inherited from class org.apache.struts.action.ActionServlet
addServletMapping, destroy, destroyApplications, destroyConfigDigester, destroyDataSources, destroyInternal, destroyModules, doGet, doPost, findDataSource, findFormBean, findForward, findMapping, getApplicationConfig, getDebug, getInternal, getModuleConfig, getRequestProcessor, getResources, initApplicationConfig, initApplicationDataSources, initApplicationMessageResources, initApplicationPlugIns, initConfigDigester, initDataSources, initInternal, initModuleConfig, initModuleDataSources, initModuleMessageResources, initModulePlugIns, initOther, initServlet, log
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANSFORMER_HANDLER_KEY

protected static final java.lang.String TRANSFORMER_HANDLER_KEY
Key the transformer handler is stored under in the servlet context

See Also:
Constant Field Values
Constructor Detail

ActionServlet

public ActionServlet()
Method Detail

init

public void init()
          throws javax.servlet.ServletException
Override the init method to load the init of stxx stuff

Throws:
javax.servlet.ServletException - If something goes wrong

reload

public void reload()
            throws java.io.IOException,
                   javax.servlet.ServletException
Override the reload method to load the init of stxx stuff

Throws:
java.io.IOException - If something goes wrong
javax.servlet.ServletException - If something goes wrong

destroyApplication

protected void destroyApplication()
Override the destroyApplication object to destroy the stxx objects


processActionForward

protected void processActionForward(ActionForward forward,
                                    org.apache.struts.action.ActionMapping mapping,
                                    org.apache.struts.action.ActionForm form,
                                    javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response)
                             throws java.io.IOException,
                                    javax.servlet.ServletException
Overrides the struts process ActionForward method to trap for transformation that need to be done. If there is no transform, then process the forward as usual. Otherwise, process the transform

Parameters:
forward - - An ActionForward object
mapping - - An ActionMapping
form - - An ActionForm
request - - The request object
response - - The response object
Throws:
java.io.IOException - - If an error occurs, throw it
javax.servlet.ServletException - - If an error occurs, throw it

initDigester

protected Digester initDigester(int detail)
Override the initDigester of the main struts class to add functionality for supporting transform tags in the tag

Parameters:
detail - - The level of debugging detail to use
Returns:
The digester

process

protected void process(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws java.io.IOException,
                       javax.servlet.ServletException
Since I cannot override the process method, I've just copied the contents here. The reason I cannot remove this is that since I've overridden methods like processActionForward and processActionPerform, just calling super.process would run all the super.processAction* methods. This would be bad and make things not work. I don't know if I have any other options.

Parameters:
request - - The request object
response - - The response object
Throws:
java.io.IOException - - If an error occurs, throw it
javax.servlet.ServletException - - If an error occurs, throw it

processValidate

protected boolean processValidate(org.apache.struts.action.ActionMapping mapping,
                                  org.apache.struts.action.ActionForm formInstance,
                                  javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response)
                           throws java.io.IOException,
                                  javax.servlet.ServletException
Call the validate() method of the specified ActionForm, and forward back to the input form if there are any errors. Return true if we should continue processing (and call the Action class perform() method), or return false if we have already forwarded control back to the input form.

Parameters:
mapping - The ActionMapping we are processing
formInstance - The ActionForm we are processing
request - The servlet request we are processing
response - The servlet response we are processing
Returns:
True if valid
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs