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
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoDelete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Removes information from the databaseprotected voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Searches for information in the databaseprotected voiddoPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Creates information in the databaseprotected voiddoPut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Updates information in the databasevoidinit()Methods inherited from class javax.servlet.http.HttpServlet
doHead, doOptions, doTrace, getLastModified, service, serviceMethods 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:
initin 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:
doPutin 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.ServletExceptionIOException
-
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:
doGetin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
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:
doPostin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
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:
doDeletein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-