Class Utils
java.lang.Object
org.glassfish.jersey.servlet.internal.Utils
Utility class.
- Author:
- Michal Gajdos
-
Method Summary
Modifier and TypeMethodDescriptiongetContextParams
(jakarta.servlet.ServletContext servletContext) Extract context params fromServletContext
.static ResourceConfig
Loadresource config
from givenservlet context
.static void
store
(ResourceConfig config, jakarta.servlet.ServletContext context, String configName) Storeresource config
as an attribute of givenservlet context
.
-
Method Details
-
store
public static void store(ResourceConfig config, jakarta.servlet.ServletContext context, String configName) Storeresource config
as an attribute of givenservlet context
. Ifconfig
isnull
then the previously stored value (if any) is removed. TheconfigName
is used as an attribute name suffix.- Parameters:
config
- resource config to be stored.context
- servlet context to store the config in.configName
- name or id of the resource config.
-
retrieve
Loadresource config
from givenservlet context
. If found then the resource config is also removed from servlet context. TheconfigName
is used as an attribute name suffix.- Parameters:
context
- servlet context to load resource config from.configName
- name or id of the resource config.- Returns:
- previously stored resource config or
null
if no resource config has been stored.
-
getContextParams
Extract context params fromServletContext
.- Parameters:
servletContext
- actual servlet context.- Returns:
- map representing current context parameters.
-