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 ResourceConfigLoadresource configfrom givenservlet context.static voidstore(ResourceConfig config, jakarta.servlet.ServletContext context, String configName) Storeresource configas an attribute of givenservlet context.
-
Method Details
-
store
public static void store(ResourceConfig config, jakarta.servlet.ServletContext context, String configName) Storeresource configas an attribute of givenservlet context. Ifconfigisnullthen the previously stored value (if any) is removed. TheconfigNameis 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 configfrom givenservlet context. If found then the resource config is also removed from servlet context. TheconfigNameis 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
nullif no resource config has been stored.
-
getContextParams
Extract context params fromServletContext.- Parameters:
servletContext- actual servlet context.- Returns:
- map representing current context parameters.
-