Class WebUtils


  • public abstract class WebUtils
    extends java.lang.Object

    This class is a clone of org.springframework.web.util.WebUtils

    Miscellaneous utilities for web applications. Used by various framework classes.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ERROR_EXCEPTION_ATTRIBUTE
      Standard Servlet 2.3+ spec request attribute for error page exception.
    • Constructor Summary

      Constructors 
      Constructor Description
      WebUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static jakarta.servlet.http.Cookie getCookie​(Translet translet, java.lang.String name)
      Retrieve the first cookie with the given name.
      static jakarta.servlet.http.Cookie getCookie​(jakarta.servlet.http.HttpServletRequest request, java.lang.String name)
      Retrieve the first cookie with the given name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ERROR_EXCEPTION_ATTRIBUTE

        public static final java.lang.String ERROR_EXCEPTION_ATTRIBUTE
        Standard Servlet 2.3+ spec request attribute for error page exception.

        To be exposed to JSPs that are marked as error pages, when forwarding to them directly rather than through the servlet container's error page resolution mechanism.

        See Also:
        Constant Field Values
    • Constructor Detail

      • WebUtils

        public WebUtils()
    • Method Detail

      • getCookie

        @Nullable
        public static jakarta.servlet.http.Cookie getCookie​(jakarta.servlet.http.HttpServletRequest request,
                                                            java.lang.String name)
        Retrieve the first cookie with the given name. Note that multiple cookies can have the same name but different paths or domains.
        Parameters:
        request - current servlet request
        name - cookie name
        Returns:
        the first cookie with the given name, or null if none is found
      • getCookie

        @Nullable
        public static jakarta.servlet.http.Cookie getCookie​(Translet translet,
                                                            java.lang.String name)
        Retrieve the first cookie with the given name. Note that multiple cookies can have the same name but different paths or domains.
        Parameters:
        translet - current translet
        name - cookie name
        Returns:
        the first cookie with the given name, or null if none is found