toolbox.web
Class AbstractStringWebAction

Package class diagram package AbstractStringWebAction
java.lang.Object
  extended by toolbox.web.BaseWebAction
      extended by toolbox.web.AbstractStringWebAction
All Implemented Interfaces:
WebAction
Direct Known Subclasses:
Sync2AsyncAction, XMLHttpLoggingAction

public abstract class AbstractStringWebAction
extends BaseWebAction
implements WebAction

A convenience WebAction implementation that may be extended to handle the body of HTTP requests as String instances.

Sub-classes must provide an implementation of the onStringBody(..) method.


Constructor Summary
protected AbstractStringWebAction()
          Protected constructor.
 
Method Summary
 void execute(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext context)
          Convert the provided request body into a String and invoke the onStringBody(..) method.
abstract  void onStringBody(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext context, java.lang.String body)
          Implementing classes must override this abstract method to implement the required request handling functionality.
 
Methods inherited from class toolbox.web.BaseWebAction
create, dispatch, getBodyAsDocument, getBodyAsString, getDisplayTemplate, getFailureTemplate, getForeignContext, getGlobalProperty, getMessage, getName, getProperties, getProperty, getResource, getResourceBundle, getResourceString, getResourceString, getResourceString, getResourceString, getResourceString, getSuccessTemplate, getTemplate, getValidator, logConfig, logFine, logFiner, logFinest, logInfo, logSevere, logWarning, redirect, split
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface toolbox.web.WebAction
create
 

Constructor Detail

AbstractStringWebAction

protected AbstractStringWebAction()
Protected constructor. This class must not be instantiated.

Method Detail

onStringBody

public abstract void onStringBody(javax.servlet.http.HttpServletRequest request,
                                  javax.servlet.http.HttpServletResponse response,
                                  javax.servlet.ServletContext context,
                                  java.lang.String body)
                           throws javax.servlet.ServletException,
                                  java.io.IOException
Implementing classes must override this abstract method to implement the required request handling functionality.

Parameters:
request - HTTP request.
response - HTTP response.
context - Web application context.
body - String instance containing the body of the request.
Throws:
javax.servlet.ServletException
java.io.IOException

execute

public void execute(javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse response,
                    javax.servlet.ServletContext context)
             throws javax.servlet.ServletException,
                    java.io.IOException
Convert the provided request body into a String and invoke the onStringBody(..) method.

Specified by:
execute in interface WebAction
Parameters:
request - HTTP request.
response - HTTP response.
context - Web application context.
Throws:
javax.servlet.ServletException
java.io.IOException