Overview

The ServletActionBroker (SAB) framework is an architecture for developing Java Servlets. This architecture builds upon the basic Servlet API in order to provide faster development, better debugging, better run time error handling, automation of data conversion between the HTTP data stream and the internal servlet data, and automatic handling of both 'application/x-form-urlencoded' and 'multipart/form-data' POST encoding types. 

Current list of features

  • Easy development of multi-method servlets.
  • Automatic servlet method selection and error checking - SAB framework determines the method required by the HTTP request through the use of the 'servletAction' variable (actual variable name is configurable at run-time)
  • Automatic parameter validation and error checking on a per servlet method basis
  • Browser review of servlet's method descriptions.
  • Automatic validation of username and password when a Security object is implemented.
  • Robust error reporting directly to the Browser or to the servlet log.
  • Extendible error reporting framework to allow servlet specific handling of errors.
  • Default parameter values can be applied to all method parameters
  • Optional parameters can be implemented by creating parameters with default values.
  • Automatic parsing of either ENCTYPE=application/x-www-form-urlencoded and ENCTYPE=multipart/form-data
  • Built in File uploading capabilities - File data is made available to the servlet through a temporary directory on the Web server.
  • Browser based method parameter configuration new! 
  • Extensible conversion factory architecture new!
  • Caching conversion resources for better performance (i.e. Strings, Hashtables, etc) new!
  • Converted parameters are placed on the "request" object for use in JSPs new!
  • MVC compatibility

This powerful framework is not a shield or wall between the basic Servlet API and the programmer. There is no hiding of the underlying Servlet API with this framework, giving the programmer access to everything that is currently available making all the functions and capabilities provided by the Servlet API are fully accessible. The SAB framework is just an extension of the Servlet API that helps developers to create programs faster and better.

Although the framework is useful for all servlet development, it is most useful for team servlet development, multi-function servlets, automation of HTTP data conversion for form processing, and file uploading. With this framework, an SAB servlet's public interface is available through a browser allowing teams of developers to check the current API. In traditional Web application development, a CGI program may provide a single function, and a set of CGI programs would provide a complete Web application. However, Servlet technology allows Web applications to reside in a single Java class and the SAB uses this capability to its fullest. SAB will automatically determine what Java method within a servlet was requested by the Browser, and, if necessary, it will validate the parameters required for the method. Converting the HTTP data stream (whether from a GET request, a POST request or 'multipart/form-data' encoding) into Java data types and validating those types as they apply to a specific Servlet method is very tedious and often redundant. The SAB automates this entire process while providing error checking at the same time. Finally, the SAB does not break down once you require file upload capabilities. File uploading is a seamless part of the SAB.

 

The Bottom Line


    The bottom line is this: during the development of a Web application, there are many tedious and error prone tasks associated with transporting the data from the Browser to the Server and back again.  The Java Servlet API has laid down a framework that helps to apply an object oriented solution to this problem but does not rid the programmer of the burden of data conversion, data validation, multi-function servlets requests, parsing 'multipart/form-data', and the coordinating query/form variable names between HTML and the servlet.  The ServletActionBroker is a framework that takes care of these areas of concern in order to allow the programmer to focus on the Web application and not the transport mechanism.