edu.jhu.tmaj.servlet
Class CommandServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by edu.jhu.tmaj.servlet.CommandServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public final class CommandServlet
extends javax.servlet.http.HttpServlet

This class handles all Requests made to the server on Apache Tomcat, and returns a Response.

See Also:
Serialized Form

Constructor Summary
CommandServlet()
           
 
Method Summary
protected  void doGet(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)
          Handles a GET request to the servlet.
 void doPost(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)
          Handles a POST Request to the servlet.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, 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

CommandServlet

public CommandServlet()
Method Detail

doPost

public final void doPost(javax.servlet.http.HttpServletRequest servletRequest,
                         javax.servlet.http.HttpServletResponse servletResponse)
Handles a POST Request to the servlet. This Deserializes the object in the supplied HttpServletRequest to class ServerRequest, then executes request.executeCommand(). If a exception occurs that the ServerRequest object does not catch, this class send the client back an ErrorResponse indicating the error. All requests are logged, as well as any ErrorResponses.

Overrides:
doPost in class javax.servlet.http.HttpServlet

doGet

protected final void doGet(javax.servlet.http.HttpServletRequest servletRequest,
                           javax.servlet.http.HttpServletResponse servletResponse)
                    throws javax.servlet.ServletException,
                           java.io.IOException
Handles a GET request to the servlet. This allows users to do a test through a webbrowser to see if they can connect to the Servlet. When users point their browsers to the Servlet's URL, they will see the data printed here. This is used for test purposes only.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException