Class AjaxHeaders

java.lang.Object
com.atlassian.jira.web.action.AjaxHeaders

public class AjaxHeaders extends Object
Utility class for dealing with AJAX request headers.
Since:
v5.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isPjaxRequest(javax.servlet.http.HttpServletRequest request)
    Returns true if the HTTP request contains the "X-PJAX" header or "X-Requested-With" header with value set to 'XMLHttpRequest'.
    static boolean
    requestUsernameMatches(javax.servlet.http.HttpServletRequest request, ApplicationUser user)
    Checks whether the effective user has change between the time when the view issue page was loaded and the time when the current request was made (this can happen due to session timeouts, logging out in another window, etc).

    Methods inherited from class java.lang.Object

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

    • AjaxHeaders

      public AjaxHeaders()
  • Method Details

    • requestUsernameMatches

      public static boolean requestUsernameMatches(javax.servlet.http.HttpServletRequest request, ApplicationUser user)
      Checks whether the effective user has change between the time when the view issue page was loaded and the time when the current request was made (this can happen due to session timeouts, logging out in another window, etc).

      This method looks at the "X-AUSERNAME" request header to determine the user that was effective at the time the page was loaded. If the request header is not present, then that is considered a match with anything.

      Parameters:
      request - a HttpServletRequest
      user - a User
      Returns:
      true if the request
    • isPjaxRequest

      public static boolean isPjaxRequest(javax.servlet.http.HttpServletRequest request)
      Returns true if the HTTP request contains the "X-PJAX" header or "X-Requested-With" header with value set to 'XMLHttpRequest'.
      Parameters:
      request - a JiraWebActionSupport
      Returns:
      a boolean