Package ch.tocco.nice2.rest.core.impl
Class Nice2JerseyServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.glassfish.jersey.servlet.ServletContainer
ch.tocco.nice2.rest.core.impl.Nice2JerseyServlet
- All Implemented Interfaces:
jakarta.servlet.Filter
,jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
,org.glassfish.jersey.server.spi.Container
@Component
public class Nice2JerseyServlet
extends org.glassfish.jersey.servlet.ServletContainer
Jersey Servlet instance for Nice2.
REST resources are contributed via
Nice2ResourceConfig
.- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final org.apache.commons.text.RandomStringGenerator
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD
Fields inherited from interface org.glassfish.jersey.server.spi.Container
DEFAULT_HTTP_PORT, DEFAULT_HTTPS_PORT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
doFilter
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain chain) Spring boot 3.3 changes the behavior if a class implements multiple servlet interfaces, likeFilter
orServlet
, it will now be registered for all of the interfaces (e.g.void
service
(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) Methods inherited from class org.glassfish.jersey.servlet.ServletContainer
destroy, doFilter, getApplicationHandler, getConfiguration, getServletContext, getStaticContentPattern, getWebComponent, init, init, init, reload, reload, service, service
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, init
Methods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, getServletName, log, log
-
Field Details
-
ERROR_ID_KEY
- See Also:
-
randomStringGenerator
public static final org.apache.commons.text.RandomStringGenerator randomStringGenerator
-
-
Constructor Details
-
Nice2JerseyServlet
public Nice2JerseyServlet()
-
-
Method Details
-
service
public void service(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) throws jakarta.servlet.ServletException, IOException - Overrides:
service
in classorg.glassfish.jersey.servlet.ServletContainer
- Throws:
jakarta.servlet.ServletException
IOException
-
doFilter
public void doFilter(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain chain) throws jakarta.servlet.ServletException, IOException Spring boot 3.3 changes the behavior if a class implements multiple servlet interfaces, likeFilter
orServlet
, it will now be registered for all of the interfaces (e.g. one registration for a filter and one for a servlet). Before this class was only registered as a servlet. InServletContainer
the next filter is not called as no `jakarta.servlet.include.request_uri` or `jersey.config.servlet.filter.staticContentRegex` is defined. Instead of configuring them, just directly forward to next filter as this is the same behavior as no filter exist.- Overrides:
doFilter
in classorg.glassfish.jersey.servlet.ServletContainer
- Throws:
jakarta.servlet.ServletException
IOException
-