org.mmbase.applications.dove.servlet
Class DoveServlet

Package class diagram package DoveServlet
java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.mmbase.servlet.MMBaseServlet
              extended by org.mmbase.applications.dove.servlet.DoveServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig, MMBaseStarter

public class DoveServlet
extends MMBaseServlet

This servlet routes RPC requests (represented in xml) to the intended method of the 'Dove' object.

Since:
MMBase-1.5
Version:
$Id: DoveServlet.java 35335 2009-05-21 08:14:41Z michiel $
Author:
Pierre van Rooden
See Also:
Serialized Form

Nested Class Summary
 class DoveServlet.DoveErrorHandler
          Dove Error handler for catching and storing parsing exceptions.
 
Field Summary
 
Fields inherited from class org.mmbase.servlet.MMBaseServlet
mmbase, retryAfter
 
Constructor Summary
DoveServlet()
           
 
Method Summary
 void doGet(HttpServletRequest req, HttpServletResponse res)
          Handles a request using the GET method.
 void doPost(HttpServletRequest req, HttpServletResponse res)
          Handles a request using the POST method.
 
Methods inherited from class org.mmbase.servlet.MMBaseServlet
associateMapping, checkInited, decRefCount, destroy, getAssociations, getBasePath, getMMBase, getRequestURL, getServletByAssociation, getServletByMapping, getServletInfo, getServletMappings, getServletMappingsByAssociation, incRefCount, init, service, setInitException, setMMBase
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, 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

DoveServlet

public DoveServlet()
Method Detail

doGet

public void doGet(HttpServletRequest req,
                  HttpServletResponse res)
           throws IOException
Handles a request using the GET method. No communication is handled through GET - this method is for testing whether the servlet is online.

Overrides:
doGet in class MMBaseServlet
Parameters:
req - the HTTP Request object
res - the HTTP Response object
Throws:
IOException

doPost

public void doPost(HttpServletRequest req,
                   HttpServletResponse res)
            throws IOException
Handles a request using the POST method. Retrieves the value of the 'xml' parameter, and parses the body of that parameter as an xml text. The resulting DOM tree is then passed to the Dove class, which runs the RPCs described in that tree. The result of Dove (also a DOM tree) is returned as xml to the client. The mime type of the result is 'text/xml', unless the 'plain' parameter is set to 'yes', in which case the mime type is 'text/plain'. Specifying a 'pretty' parameter with value 'yes' results in pretty printed xml. Both these parameters are ment for debugging.
XXX: Possibly we want to use xml directly in the body, instead of parameters.
XXX: Daniel suggested using CRC to validate calls. This is not implemented yet.
XXX: We have not yet established how we will use session-info and usercontext.

Overrides:
doPost in class HttpServlet
Parameters:
req - the HTTP Request object
res - the HTTP Response object
Throws:
IOException


MMBase Dove 2.0-SNAPSHOT - 2013-03-30T06:41