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
FieldsModifier and TypeFieldDescriptionstatic final org.apache.commons.text.RandomStringGeneratorstatic final StringFields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEADFields inherited from interface org.glassfish.jersey.server.spi.Container
DEFAULT_HTTP_PORT, DEFAULT_HTTPS_PORT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoFilter(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, likeFilterorServlet, it will now be registered for all of the interfaces (e.g.voidservice(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, serviceMethods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, initMethods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, getServletName, log, log
-
Field Details
-
REQUEST_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:
servicein classorg.glassfish.jersey.servlet.ServletContainer- Throws:
jakarta.servlet.ServletExceptionIOException
-
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, likeFilterorServlet, 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. InServletContainerthe 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:
doFilterin classorg.glassfish.jersey.servlet.ServletContainer- Throws:
jakarta.servlet.ServletExceptionIOException
-