com.mortbay.Servlets
Class PropertyTreeEditor

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--com.mortbay.Servlets.PropertyTreeEditor

public class PropertyTreeEditor
extends javax.servlet.http.HttpServlet

Servlet to handle navigation and editing of a PropertyTree

This servlet uses the ServletDispatch class to carry out navigation over a tree of HTTP handlers that mirror the structure of my model, in this case being a PropertyTree. Each node in the HTTP handling tree is a ServletNode (to aid in generation of URL's) and the standard operations on tree nodes (Set, Remove, Save, Load) are defined on this object as methods for the Dispatcher to call. The defaultDispatch method handles navigation down to sub-nodes.

Version:
1.0 Sun Feb 21 1999
Author:
Matthew Watson (mattw)
See Also:
ServletDispatch, ServletDispatchHandler, ServletNode, PropertyTree, Serialized Form

Inner Class Summary
static class PropertyTreeEditor.Context
           
static class PropertyTreeEditor.EditArgs
           
 class PropertyTreeEditor.EditorDispatcher
           
static class PropertyTreeEditor.PruneArgs
           
 
Constructor Summary
PropertyTreeEditor()
           
 
Method Summary
 void init(javax.servlet.ServletConfig config)
          Initializes this servlet.
 void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Receives standard HTTP requests from the public service method and dispatches them to the doxxx methods defined in this class.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyTreeEditor

public PropertyTreeEditor()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Description copied from class: javax.servlet.GenericServlet
Initializes this servlet.

The servlet engine calls this method once, automatically, each time it loads the servlet. This method is guaranteed to finish before the servlet accepts any requests to its service method. If a fatal error occurs while the servlet is being initialized, the servlet engine should throw an UnavailableException, rather than calling the System.exit method.

The init method stores the ServletConfig object it receives from the servlet engine. If you override init, you should either call super.init or store the ServletConfig object in the new init method. If you decide to store the ServletConfig object in a different location, you should also override the GenericServlet.getServletConfig() method.

Overrides:
init in class javax.servlet.GenericServlet
Tags copied from class: javax.servlet.GenericServlet
Parameters:
config - the ServletConfig object that contains initialization parameters for this servlet
Throws:
javax.servlet.ServletException - if an exception occurs that interrupts the servlet's normal operation
See Also:
UnavailableException

service

public void service(javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse res)
             throws javax.servlet.ServletException,
                    java.io.IOException
Description copied from class: javax.servlet.http.HttpServlet
Receives standard HTTP requests from the public service method and dispatches them to the doxxx methods defined in this class. This method is an HTTP-specific version of the javax.servlet.Servlet.service method. You will probably not need to override this method.
Overrides:
service in class javax.servlet.http.HttpServlet
Tags copied from class: javax.servlet.http.HttpServlet
Parameters:
req - the HttpServletRequest object that contains the request the client made of the servlet
resp - the HttpServletResponse object that contains the response the servlet returns to the client
Throws:
java.io.IOException - if an input or output error occurs while the servlet is handling the TRACE request
javax.servlet.ServletException - if the request for the TRACE cannot be handled
See Also:
Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)