Class RequestUtils

java.lang.Object
org.apache.struts2.RequestUtils

public class RequestUtils extends Object
Request handling utility class.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    getServletPath(jakarta.servlet.http.HttpServletRequest request)
    Retrieves the current request servlet path.
    static String
    getUri(jakarta.servlet.http.HttpServletRequest request)
    Gets the uri from the request
    static Date
    Parse input string as date in formats defined for If-Modified-Since header, see: https://issues.apache.org/jira/browse/WW-4263 https://web.archive.org/web/20081014021349/http://rfc.net/rfc2616.html#p20

    Methods inherited from class java.lang.Object

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

    • RequestUtils

      public RequestUtils()
  • Method Details

    • getServletPath

      public static String getServletPath(jakarta.servlet.http.HttpServletRequest request)
      Retrieves the current request servlet path. Deals with differences between servlet specs (2.2 vs 2.3+)
      Parameters:
      request - the request
      Returns:
      the servlet path
    • getUri

      public static String getUri(jakarta.servlet.http.HttpServletRequest request)
      Gets the uri from the request
      Parameters:
      request - The request
      Returns:
      The uri
    • parseIfModifiedSince

      public static Date parseIfModifiedSince(String headerValue)
      Parse input string as date in formats defined for If-Modified-Since header, see: https://issues.apache.org/jira/browse/WW-4263 https://web.archive.org/web/20081014021349/http://rfc.net/rfc2616.html#p20
      Parameters:
      headerValue - value of If-Modified-Since header
      Returns:
      proper date or null