All Packages  This Package  Class Hierarchy  Class Search  Index

Class kh.servlet.BasicWrapper
java.lang.Object
   |
   +----javax.servlet.GenericServlet
           |
           +----javax.servlet.http.HttpServlet
                   |
                   +----kh.servlet.BaseServlet
                           |
                           +----kh.servlet.BasicWrapper

  Summary

public abstract class  BasicWrapper
     extends kh.servlet.BaseServlet
{
          // Constructors 1
     public BasicWrapper();

          // Methods 5
     public void doGet(HttpServletRequest, HttpServletResponse) throws ServletException, IOException;
     public void doGet(HttpServletRequest, HttpServletResponse, StreamReplacement) throws ServletException, IOException;
     protected abstract InputStream getPageStream(HttpServletRequest, HttpServletResponse) throws IOException;
     protected InputStream getPostfixStream(HttpServletRequest);
     protected InputStream getPrefixStream(HttpServletRequest);
}

This servlet will resolve URLs and prepend or postpend programmatically generated data. This allows for a standard prepend/postpend of a standard web page

Author:
Kevin Hester


  Cross Reference

Extended By:
PageWrapper





  Constructors

· BasicWrapper

Summary  |  Top
   public BasicWrapper() 

Default constructor



  Methods

· doGet

Summary  |  Top
   public void doGet(HttpServletRequest req, 
                     HttpServletResponse res)  throws ServletException, IOException

Fetch a web page for the inner portion of the page content

Parameter Description
req the request we read from
res the response we write to

Overrides:
doGet in class HttpServlet


· doGet

Summary  |  Top
   public void doGet(HttpServletRequest req, 
                     HttpServletResponse res, 
                     StreamReplacement replaceSet)  throws ServletException, IOException

This method is used to implement the standard two argument doGet described above. However, this flavor provides a parameter for a replacement applied to the output stream. This feature is a 'free' side effect of the engine used to send the page.

Parameter Description
req the request we read from
replaceSet the replacements applied to the sent stream
res the response we write to



· getPageStream

Summary  |  Top
   protected abstract InputStream getPageStream(HttpServletRequest req, 
                                                HttpServletResponse res)  throws IOException

Subclasses must provide this method to generate the dynamic web page content. Static content is returned by getPrefix/getPostfix stream.



· getPostfixStream

Summary  |  Top
   protected InputStream getPostfixStream(HttpServletRequest req) 

Returns the stream which should be apended to this page, or NULL for no stream.

Returns:
null - subclass to change the behavior


· getPrefixStream

Summary  |  Top
   protected InputStream getPrefixStream(HttpServletRequest req) 

Returns the stream which should be prepended to this page, or NULL for no stream.

Returns:
null - subclass to change the behavior


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7