Class AjaxRequestWrapper

java.lang.Object
javax.servlet.ServletRequestWrapper
javax.servlet.http.HttpServletRequestWrapper
com.jalios.jcms.ajax.AjaxRequestWrapper
All Implemented Interfaces:
javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest

public class AjaxRequestWrapper extends javax.servlet.http.HttpServletRequestWrapper
  • Field Summary

    Fields inherited from interface javax.servlet.http.HttpServletRequest

    BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
  • Constructor Summary

    Constructors
    Constructor
    Description
    AjaxRequestWrapper(javax.servlet.http.HttpServletRequest req, JcmsJspAjaxContext jjac)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    disableParameterPropagation(javax.servlet.ServletRequest request)
     
    static void
    enableParameterPropagation(javax.servlet.ServletRequest request)
     
     
     
     
    Return the Original parameter map
    Retrieve the path info of the origina unwrapped request
    Retrieve the servlet path of the origina unwrapped request
     
     
     
     
     
     
     
     
     
    protected boolean
     
    static boolean
    Checks if automatic propagation of request parameters from the initial request to subsequent Ajax Refresh requests is enabled (true) or disable (false).
    static void
    restoreDefaultParameterPropagation(javax.servlet.ServletRequest request)
     
    static void
    Overrides request attributes by fake request attributes
    void
     
    static void
    useFakeRequest(boolean use)
    Activate/Desactivate use of the fake request.

    Methods inherited from class javax.servlet.http.HttpServletRequestWrapper

    authenticate, changeSessionId, getAuthType, getCookies, getDateHeader, getHeaderNames, getHeaders, getHttpServletMapping, getIntHeader, getMethod, getPart, getParts, getRemoteUser, getRequestedSessionId, getRequestURL, getSession, getSession, getTrailerFields, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isTrailerFieldsReady, isUserInRole, login, logout, newPushBuilder, upgrade

    Methods inherited from class javax.servlet.ServletRequestWrapper

    getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface javax.servlet.ServletRequest

    getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocales, getLocalName, getLocalPort, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
  • Constructor Details

    • AjaxRequestWrapper

      public AjaxRequestWrapper(javax.servlet.http.HttpServletRequest req, JcmsJspAjaxContext jjac)
  • Method Details

    • isParametersPropagationEnabled

      public static boolean isParametersPropagationEnabled()
      Checks if automatic propagation of request parameters from the initial request to subsequent Ajax Refresh requests is enabled (true) or disable (false).

      Request parameter propagation is disabled by default in JCMS 10 (since JCMS-4951).
      It can be overrided through JCMS property channel.ajax.propagate-parameters: true if any unexpected behavior were to occur following this change.

      This method and all automatic parameters propagation code will be removed in JCMS 11, unless major issue is found. cf JCMS-6097.

      A restart is required if stil property is changed.

      Returns:
      true if initial parameters must be propagated to ajax request (JCMS 9 behavior), false otheriwse (JCMS 10 behavior)
      Since:
      JCMS-4951
    • getRequestURI

      public String getRequestURI()
      Specified by:
      getRequestURI in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getRequestURI in class javax.servlet.http.HttpServletRequestWrapper
    • getContextPath

      public String getContextPath()
      Specified by:
      getContextPath in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getContextPath in class javax.servlet.http.HttpServletRequestWrapper
    • getPathInfo

      public String getPathInfo()
      Specified by:
      getPathInfo in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getPathInfo in class javax.servlet.http.HttpServletRequestWrapper
    • getPathTranslated

      public String getPathTranslated()
      Specified by:
      getPathTranslated in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getPathTranslated in class javax.servlet.http.HttpServletRequestWrapper
    • getQueryString

      public String getQueryString()
      Specified by:
      getQueryString in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getQueryString in class javax.servlet.http.HttpServletRequestWrapper
    • getServletPath

      public String getServletPath()
      Specified by:
      getServletPath in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getServletPath in class javax.servlet.http.HttpServletRequestWrapper
    • getOriginalServletPath

      public String getOriginalServletPath()
      Retrieve the servlet path of the origina unwrapped request
      Returns:
      the servlet path of the origina unwrapped request
      Since:
      jcms-7.0.3
    • getOriginalPathInfo

      public String getOriginalPathInfo()
      Retrieve the path info of the origina unwrapped request
      Returns:
      the path info of the origina unwrapped request
      Since:
      jcms-7.0.3
    • getLocale

      public Locale getLocale()
      Specified by:
      getLocale in interface javax.servlet.ServletRequest
      Overrides:
      getLocale in class javax.servlet.ServletRequestWrapper
    • disableParameterPropagation

      public static void disableParameterPropagation(javax.servlet.ServletRequest request)
    • enableParameterPropagation

      public static void enableParameterPropagation(javax.servlet.ServletRequest request)
    • restoreDefaultParameterPropagation

      public static void restoreDefaultParameterPropagation(javax.servlet.ServletRequest request)
    • isParameterPropagationDisabled

      protected boolean isParameterPropagationDisabled()
    • getParameter

      public String getParameter(String name)
      Specified by:
      getParameter in interface javax.servlet.ServletRequest
      Overrides:
      getParameter in class javax.servlet.ServletRequestWrapper
    • getParameterMap

      public Map<String,String[]> getParameterMap()
      Specified by:
      getParameterMap in interface javax.servlet.ServletRequest
      Overrides:
      getParameterMap in class javax.servlet.ServletRequestWrapper
    • getOriginalParameterMap

      public Map<String,String[]> getOriginalParameterMap()
      Return the Original parameter map
      Returns:
      the parameter map of the original request
      Since:
      jcms-7.0.0
    • getParameterNames

      public Enumeration<String> getParameterNames()
      Specified by:
      getParameterNames in interface javax.servlet.ServletRequest
      Overrides:
      getParameterNames in class javax.servlet.ServletRequestWrapper
    • getParameterValues

      public String[] getParameterValues(String name)
      Specified by:
      getParameterValues in interface javax.servlet.ServletRequest
      Overrides:
      getParameterValues in class javax.servlet.ServletRequestWrapper
    • getHeader

      public String getHeader(String name)
      Specified by:
      getHeader in interface javax.servlet.http.HttpServletRequest
      Overrides:
      getHeader in class javax.servlet.http.HttpServletRequestWrapper
    • setRequestAttributes

      public void setRequestAttributes()
    • useFakeRequest

      public static void useFakeRequest(boolean use)
      Activate/Desactivate use of the fake request. Fake Request must be desactivated before called by Application Server not to override the ServletPath.
      Parameters:
      use - the new state
    • setFakeAttributes

      public static void setFakeAttributes()
      Overrides request attributes by fake request attributes