Package org.glassfish.jersey.servlet
Class WebComponent
- java.lang.Object
-
- org.glassfish.jersey.servlet.WebComponent
-
public class WebComponent extends Object
An common Jersey web component that may be extended by a Servlet and/or Filter implementation, or encapsulated by a Servlet or Filter implementation.- Author:
- Paul Sandoz, Jakub Podlesak, Marek Potociar, Martin Matula, Libor Kramolis
-
-
Constructor Summary
Constructors Constructor Description WebComponent(WebConfig webConfig, ResourceConfig resourceConfig)Create and initialize new web component instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApplicationHandlergetAppHandler()GetApplicationHandlerused by this web component.org.glassfish.jersey.internal.util.collection.Value<Integer>service(URI baseUri, URI requestUri, jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.http.HttpServletResponse servletResponse)Dispatch client requests to a resource class.
-
-
-
Constructor Detail
-
WebComponent
public WebComponent(WebConfig webConfig, ResourceConfig resourceConfig) throws jakarta.servlet.ServletException
Create and initialize new web component instance.- Parameters:
webConfig- we component configuration.resourceConfig- Jersey application configuration.- Throws:
jakarta.servlet.ServletException- in case the Jersey application cannot be created from the supplied resource configuration.
-
-
Method Detail
-
service
public org.glassfish.jersey.internal.util.collection.Value<Integer> service(URI baseUri, URI requestUri, jakarta.servlet.http.HttpServletRequest servletRequest, jakarta.servlet.http.HttpServletResponse servletResponse) throws jakarta.servlet.ServletException, IOException
Dispatch client requests to a resource class.- Parameters:
baseUri- the base URI of the request.requestUri- the URI of the request.servletRequest- theHttpServletRequestobject that contains the request the client made to the Web component.servletResponse- theHttpServletResponseobject that contains the response the Web component returns to the client.- Returns:
- lazily initialized response status code
value provider. If not resolved in the moment of call toValue.get(),-1is returned. - Throws:
IOException- if an input or output error occurs while the Web component is handling the HTTP request.jakarta.servlet.ServletException- if the HTTP request cannot be handled.
-
getAppHandler
public ApplicationHandler getAppHandler()
GetApplicationHandlerused by this web component.- Returns:
- The application handler
-
-