org.jmonit.web
Class RestServlet2

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

public class RestServlet2
extends javax.servlet.http.HttpServlet

Access to the repository datas using REST URLs. Inspired by stapler to convert a REST path to navigation in Java object graph, but dedicated to monitors and features handling.

Author:
Nicolas De Loof
See Also:
https://stapler.dev.java.net/what-is.html, Serialized Form

Constructor Summary
RestServlet2()
           
 
Method Summary
protected  java.lang.Object findResource(java.lang.String path, java.lang.Object root)
           
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  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

RestServlet2

public RestServlet2()
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)

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

findResource

protected java.lang.Object findResource(java.lang.String path,
                                        java.lang.Object root)
                                 throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2007 Nicolas De Loof. All Rights Reserved.