org.jmonit.web
Class RestServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.jmonit.web.RestServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class RestServlet
extends javax.servlet.http.HttpServlet

Author:
Nicolas De Loof
See Also:
Serialized Form

Constructor Summary
RestServlet()
           
 
Method Summary
protected  Renderer getRenderer(java.util.List<java.lang.String> mimeTypes, javax.servlet.http.HttpServletResponse response)
          Find the best renderer according to the accept header (mime-type)
protected  java.lang.Object getRestResource(java.lang.StringBuffer path)
          Find the jmonit resource pointed by the request path.
protected  void restService(java.lang.String path, java.util.List<java.lang.String> mimeTypes, javax.servlet.http.HttpServletResponse response)
           
protected  void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestServlet

public RestServlet()
Method Detail

service

protected void service(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws javax.servlet.ServletException,
                       java.io.IOException

Overrides:
service in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException
See Also:
HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

restService

protected void restService(java.lang.String path,
                           java.util.List<java.lang.String> mimeTypes,
                           javax.servlet.http.HttpServletResponse response)
                    throws java.io.IOException
Throws:
java.io.IOException

getRestResource

protected java.lang.Object getRestResource(java.lang.StringBuffer path)
Find the jmonit resource pointed by the request path.

Parameters:
request - HTTP request
Returns:
a resource objet

getRenderer

protected Renderer getRenderer(java.util.List<java.lang.String> mimeTypes,
                               javax.servlet.http.HttpServletResponse response)
                        throws java.io.IOException
Find the best renderer according to the accept header (mime-type)

Parameters:
request - HTTP request
response - HTTP response
Returns:
a renderer
Throws:
java.io.IOException - some error occured


Copyright © 2007 Nicolas De Loof. All Rights Reserved.