Class HttpServletUtils


  • public final class HttpServletUtils
    extends Object
    A utility class for HTTP servlets.
    Author:
    Rob Spoor
    • Method Detail

      • forEachHeader

        public static void forEachHeader​(HttpServletRequest request,
                                         BiConsumer<? super String,​? super String> action)
        Executes an action for each header in a request.
        Parameters:
        request - The request.
        action - The action to execute.
        Throws:
        NullPointerException - If the request or action is null.
      • forEachHeader

        public static void forEachHeader​(HttpServletResponse response,
                                         BiConsumer<? super String,​? super String> action)
        Executes an action for each header in a response.
        Parameters:
        response - The response.
        action - The action to execute.
        Throws:
        NullPointerException - If the response or action is null.