Class JKWebContextUtil

java.lang.Object
com.jk.web.util.JKWebContextUtil

public class JKWebContextUtil extends Object
This class is a utility class for handling web context-related operations.
Version:
1.0
Author:
Dr. Jalal H. Kiswani
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    getHeadersMap(jakarta.servlet.http.HttpServletRequest request)
    This method retrieves a map of request headers from an HttpServletRequest.
    getRequestMap(jakarta.servlet.http.HttpServletRequest request, boolean includeParams)
    This method retrieves a map of request attributes from an HttpServletRequest.
    getSessionMap(jakarta.servlet.http.HttpSession httpSession)
    This method retrieves a map of session attributes from an HTTP session.
    static void
    sync(jakarta.servlet.http.HttpServletRequest request)
    This method synchronizes the JKWebContext with information from the HttpServletRequest.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JKWebContextUtil

      public JKWebContextUtil()
  • Method Details

    • getSessionMap

      public static HashMap<String,Object> getSessionMap(jakarta.servlet.http.HttpSession httpSession)
      This method retrieves a map of session attributes from an HTTP session.
      Parameters:
      httpSession - Specifies the HttpSession from which to retrieve attributes.
      Returns:
      a HashMap containing session attribute names and their corresponding values.
    • getRequestMap

      public static HashMap<String,Object> getRequestMap(jakarta.servlet.http.HttpServletRequest request, boolean includeParams)
      This method retrieves a map of request attributes from an HttpServletRequest.
      Parameters:
      request - Specifies the HttpServletRequest from which to retrieve attributes.
      includeParams - Indicates whether to include request parameters in the map.
      Returns:
      a HashMap containing request attribute names and their corresponding values.
    • sync

      public static void sync(jakarta.servlet.http.HttpServletRequest request)
      This method synchronizes the JKWebContext with information from the HttpServletRequest.
      Parameters:
      request - Specifies the HttpServletRequest containing information to synchronize.
    • getHeadersMap

      public static HashMap<String,String> getHeadersMap(jakarta.servlet.http.HttpServletRequest request)
      This method retrieves a map of request headers from an HttpServletRequest.
      Parameters:
      request - Specifies the HttpServletRequest from which to retrieve headers.
      Returns:
      a HashMap containing request header names and their corresponding values.