Package edu.pdx.cs410J.servlets
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
A servlet that provides REST access to a movie database
- See Also:
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doDelete
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Removes information from the databaseprotected void
doGet
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Searches for information in the databaseprotected void
doPost
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Creates information in the databaseprotected void
doPut
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Updates information in the databasevoid
init()
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
-
Constructor Details
-
MovieDatabaseServlet
public MovieDatabaseServlet()
-
-
Method Details
-
init
- Overrides:
init
in classjavax.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 classjavax.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} returnsnull
- 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 classjavax.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 classjavax.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 classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-