Package ejava.examples.webtier.web
Class RegistrarHandlerServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- ejava.examples.webtier.web.RegistrarHandlerServlet
-
- All Implemented Interfaces:
Serializable
,Servlet
,ServletConfig
public class RegistrarHandlerServlet extends HttpServlet
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
RegistrarHandlerServlet.CreateStudent
private class
RegistrarHandlerServlet.GenerateStudents
private class
RegistrarHandlerServlet.GetStudent
private class
RegistrarHandlerServlet.GetStudents
private class
RegistrarHandlerServlet.Handler
private class
RegistrarHandlerServlet.RemoveStudent
-
Field Summary
Fields Modifier and Type Field Description private Map<String,RegistrarHandlerServlet.Handler>
handlers
private org.slf4j.Logger
logger
-
Constructor Summary
Constructors Constructor Description RegistrarHandlerServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doGet(HttpServletRequest request, HttpServletResponse response)
protected void
doPost(HttpServletRequest request, HttpServletResponse response)
protected Registrar
getRegistrar()
Create a new instance of the registrar per request so that we do not have two calling threads using the same instance.void
init()
-
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, log, log
-
-
-
-
Field Detail
-
logger
private org.slf4j.Logger logger
-
handlers
private Map<String,RegistrarHandlerServlet.Handler> handlers
-
-
Method Detail
-
init
public void init()
- Overrides:
init
in classGenericServlet
-
getRegistrar
protected Registrar getRegistrar()
Create a new instance of the registrar per request so that we do not have two calling threads using the same instance. JPAFilter will return the same EntityManager instance to all calls within the same thread.- Returns:
-
doGet
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
- Overrides:
doGet
in classHttpServlet
- Throws:
ServletException
IOException
-
doPost
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
- Overrides:
doPost
in classHttpServlet
- Throws:
ServletException
IOException
-
-