net.jxta.impl.endpoint.servlethttp
Class HttpMessageServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
net.jxta.impl.endpoint.servlethttp.HttpMessageServlet
- All Implemented Interfaces:
- Serializable, Servlet, ServletConfig
public class HttpMessageServlet
- extends HttpServlet
This is a simple servlet that accepts POSTed Jxta messages over HTTP
and hands them up to EndpointService. It also supports a ping operation. When
the URI is /ping, it simply responds with a 200.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpMessageServlet
public HttpMessageServlet()
init
public void init(ServletConfig config)
throws ServletException
- Stores the endpoint from the ServletContext in to the data member
for easy access.
- Specified by:
init
in interface Servlet
- Overrides:
init
in class GenericServlet
- Throws:
ServletException
doGet
public void doGet(HttpServletRequest req,
HttpServletResponse res)
throws ServletException,
IOException
- Handle the ping by sending back a 200.
- Overrides:
doGet
in class HttpServlet
- Throws:
ServletException
IOException
doPost
public void doPost(HttpServletRequest req,
HttpServletResponse res)
throws ServletException,
IOException
- Handle posted messages. We first validate the message, which is where
we check the content-length of the message. If that passes
- Overrides:
doPost
in class HttpServlet
- Throws:
ServletException
IOException
destroy
public void destroy()
- Specified by:
destroy
in interface Servlet
- Overrides:
destroy
in class GenericServlet