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 classRegistrarHandlerServlet.CreateStudentprivate classRegistrarHandlerServlet.GenerateStudentsprivate classRegistrarHandlerServlet.GetStudentprivate classRegistrarHandlerServlet.GetStudentsprivate classRegistrarHandlerServlet.Handlerprivate classRegistrarHandlerServlet.RemoveStudent
-
Field Summary
Fields Modifier and Type Field Description private Map<String,RegistrarHandlerServlet.Handler>handlersprivate org.slf4j.Loggerlogger
-
Constructor Summary
Constructors Constructor Description RegistrarHandlerServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoGet(HttpServletRequest request, HttpServletResponse response)protected voiddoPost(HttpServletRequest request, HttpServletResponse response)protected RegistrargetRegistrar()Create a new instance of the registrar per request so that we do not have two calling threads using the same instance.voidinit()-
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:
initin 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:
doGetin classHttpServlet- Throws:
ServletExceptionIOException
-
doPost
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
- Overrides:
doPostin classHttpServlet- Throws:
ServletExceptionIOException
-
-