java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
me.chrisswr1.test.webapp.BaseServlet
- All Implemented Interfaces:
Servlet,ServletConfig,Serializable
- Direct Known Subclasses:
MainServlet
HttpServlet, which merges the request methods GET and POST- Since:
- 1.0.0
- Version:
- 3.0.0
- See Also:
-
Field Summary
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoGet(@Nullable HttpServletRequest request, @Nullable HttpServletResponse response) protected voiddoPost(@Nullable HttpServletRequest request, @Nullable HttpServletResponse response) protected abstract voiddoRequest(@Nullable HttpServletRequest request, @Nullable HttpServletResponse response) Handles a request.Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPatch, doPut, doTrace, getLastModified, init, isSensitiveHeader, service, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Constructor Details
-
BaseServlet
public BaseServlet()
-
-
Method Details
-
doRequest
protected abstract void doRequest(@Nullable @Nullable HttpServletRequest request, @Nullable @Nullable HttpServletResponse response) throws IOException Handles a request. Independent to the method (GET or POST).- Parameters:
request- theHttpServletRequestfrom the clientresponse- theHttpServletResponse, which will be sent to the client- Throws:
IOException- if any in- or outputExceptionoccurred- Since:
- 1.0.0
- See Also:
-
doGet
protected void doGet(@Nullable @Nullable HttpServletRequest request, @Nullable @Nullable HttpServletResponse response) throws IOException - Overrides:
doGetin classHttpServlet- Throws:
IOException
-
doPost
protected void doPost(@Nullable @Nullable HttpServletRequest request, @Nullable @Nullable HttpServletResponse response) throws IOException - Overrides:
doPostin classHttpServlet- Throws:
IOException
-