Class MovieDatabaseServlet

java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
edu.pdx.cs410J.servlets.MovieDatabaseServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class MovieDatabaseServlet extends javax.servlet.http.HttpServlet
A servlet that provides REST access to a movie database
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    (package private) static enum 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    doDelete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    Removes information from the database
    protected void
    doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    Searches for information in the database
    protected void
    doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    Creates information in the database
    protected void
    doPut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    Updates information in the database
    void
     

    Methods inherited from class javax.servlet.http.HttpServlet

    doHead, doOptions, doTrace, getLastModified, service, service

    Methods inherited from class javax.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • init

      public void init() throws javax.servlet.ServletException
      Overrides:
      init in class javax.servlet.GenericServlet
      Throws:
      javax.servlet.ServletException
    • doPut

      protected void doPut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
      Updates information in the database
      Overrides:
      doPut in class javax.servlet.http.HttpServlet
      Parameters:
      request - The request from the client. Note that unlike POST, data arrives in the body (conent) of the request. {#link getParameter} returns null
      Throws:
      javax.servlet.ServletException
      IOException
    • doGet

      protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
      Searches for information in the database
      Overrides:
      doGet in class javax.servlet.http.HttpServlet
      Throws:
      javax.servlet.ServletException
      IOException
    • doPost

      protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
      Creates information in the database
      Overrides:
      doPost in class javax.servlet.http.HttpServlet
      Throws:
      javax.servlet.ServletException
      IOException
    • doDelete

      protected void doDelete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
      Removes information from the database
      Overrides:
      doDelete in class javax.servlet.http.HttpServlet
      Throws:
      javax.servlet.ServletException
      IOException