MDi JLib
1.7.4

com.microdeveloper.servlets.io
Class JspHtmlWriter

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.microdeveloper.servlets.io.JspHtmlWriter
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class JspHtmlWriter
extends HttpServlet

This servlet will take the output of a JSP page and save it to a local file. This enables applications that collect dynamic output and buffer or cache them for future requests.

The servlet requires that several parameters are established in the servlet configuration which are:

  • fileDestination - This is the default location where you want the output written to
  • successPage - This is the page indicating that the operation succeeded.
  • failurePage - This is the page indicating that the operation failed.
  • usagePage - This is the page describing the usage of the application.
  • Here are a few examples for success page, usage page, and a failure page.

    The servlet responds to two parameters, "url" and "name".

  • url - the URL to interpret and save as a file
  • name - the name of the desired output file (including the path)
  • Since:
    1.3
    Version:
    1.0
    Author:
    MicroDeveloper, Inc.
    See Also:
    Serialized Form

    Constructor Summary
    JspHtmlWriter()
               
     
    Method Summary
     void destroy()
              Destroys the servlet.
    protected  void doGet(HttpServletRequest request, HttpServletResponse response)
              Handles the HTTP GET method.
    protected  void doPost(HttpServletRequest request, HttpServletResponse response)
              Handles the HTTP POST method.
     String getServletInfo()
              Returns a short description of the servlet.
     void init(ServletConfig config)
              Initializes the servlet.
    protected  void processRequest(HttpServletRequest request, HttpServletResponse response)
              Processes requests for both HTTP GET and POST methods.
     
    Methods inherited from class javax.servlet.http.HttpServlet
    doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
     
    Methods inherited from class javax.servlet.GenericServlet
    getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    JspHtmlWriter

    public JspHtmlWriter()
    Method Detail

    init

    public void init(ServletConfig config)
              throws ServletException
    Initializes the servlet.

    Specified by:
    init in interface Servlet
    Overrides:
    init in class GenericServlet
    Throws:
    ServletException

    destroy

    public void destroy()
    Destroys the servlet.

    Specified by:
    destroy in interface Servlet
    Overrides:
    destroy in class GenericServlet

    processRequest

    protected void processRequest(HttpServletRequest request,
                                  HttpServletResponse response)
                           throws ServletException,
                                  IOException
    Processes requests for both HTTP GET and POST methods.

    Parameters:
    request - servlet request
    response - servlet response
    Throws:
    ServletException
    IOException

    doGet

    protected void doGet(HttpServletRequest request,
                         HttpServletResponse response)
                  throws ServletException,
                         IOException
    Handles the HTTP GET method.

    Overrides:
    doGet in class HttpServlet
    Parameters:
    request - servlet request
    response - servlet response
    Throws:
    ServletException
    IOException

    doPost

    protected void doPost(HttpServletRequest request,
                          HttpServletResponse response)
                   throws ServletException,
                          IOException
    Handles the HTTP POST method.

    Overrides:
    doPost in class HttpServlet
    Parameters:
    request - servlet request
    response - servlet response
    Throws:
    ServletException
    IOException

    getServletInfo

    public String getServletInfo()
    Returns a short description of the servlet.

    Specified by:
    getServletInfo in interface Servlet
    Overrides:
    getServletInfo in class GenericServlet

    MDi JLib
    1.7.4

    Copyright©2001-2007 MicroDeveloper, Inc. All Rights Reserved.