Class WebUtils

java.lang.Object
io.microsphere.spring.web.servlet.util.WebUtils

public abstract class WebUtils extends Object
Web Utilities Class
Since:
1.0.0
Author:
Mercy
See Also:
  • Constructor Details

    • WebUtils

      public WebUtils()
  • Method Details

    • isRunningBelowServlet3Container

      public static boolean isRunningBelowServlet3Container()
      Is Running below Servlet 3 Container
      Returns:
      If below , true
    • getServletContext

      public static jakarta.servlet.ServletContext getServletContext(jakarta.servlet.http.HttpServletRequest request)
      Get ServletContext from HttpServletRequest
      Parameters:
      request - HttpServletRequest
      Returns:
      non-null
    • findFilterRegistrations

      public static Map<String,? extends jakarta.servlet.FilterRegistration> findFilterRegistrations(jakarta.servlet.ServletContext servletContext, Class<? extends jakarta.servlet.Filter> filterClass)
      Find the map of FilterRegistration in specified Filter Class
      Parameters:
      servletContext - ServletContext
      filterClass - The of class of Filter
      Returns:
      the map of ServletRegistration
    • findServletRegistrations

      public static Map<String,? extends jakarta.servlet.ServletRegistration> findServletRegistrations(jakarta.servlet.ServletContext servletContext, Class<? extends jakarta.servlet.Servlet> servletClass)
      Find the map of ServletRegistration in specified Servlet Class
      Parameters:
      servletContext - ServletContext
      servletClass - The of class of Servlet
      Returns:
      the unmodifiable map of ServletRegistration
    • findRegistrations

      protected static <R extends jakarta.servlet.Registration> Map<String,R> findRegistrations(jakarta.servlet.ServletContext servletContext, Map<String,R> registrationsMap, Class<?> targetClass)
      Find the map of Registration in specified Class
      Type Parameters:
      R - the subtype of Registration
      Parameters:
      servletContext - ServletContext
      registrationsMap - the map of Registration
      targetClass - the target Class
      Returns:
      the unmodifiable map of Registration i