Class 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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void disableParameterPropagation​(javax.servlet.ServletRequest request)  
      static void enableParameterPropagation​(javax.servlet.ServletRequest request)  
      java.lang.String getContextPath()  
      java.lang.String getHeader​(java.lang.String name)  
      java.util.Locale getLocale()  
      java.util.Map<java.lang.String,​java.lang.String[]> getOriginalParameterMap()
      Return the Original parameter map
      java.lang.String getOriginalPathInfo()
      Retrieve the path info of the origina unwrapped request
      java.lang.String getOriginalServletPath()
      Retrieve the servlet path of the origina unwrapped request
      java.lang.String getParameter​(java.lang.String name)  
      java.util.Map<java.lang.String,​java.lang.String[]> getParameterMap()  
      java.util.Enumeration<java.lang.String> getParameterNames()  
      java.lang.String[] getParameterValues​(java.lang.String name)  
      java.lang.String getPathInfo()  
      java.lang.String getPathTranslated()  
      java.lang.String getQueryString()  
      java.lang.String getRequestURI()  
      java.lang.String getServletPath()  
      protected boolean isParameterPropagationDisabled()  
      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).
      static void restoreDefaultParameterPropagation​(javax.servlet.ServletRequest request)  
      static void setFakeAttributes()
      Overrides request attributes by fake request attributes
      void setRequestAttributes()  
      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 Detail

      • AjaxRequestWrapper

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

      • 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.

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

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

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

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

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

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

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

        public java.lang.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 java.lang.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 java.util.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 java.lang.String getParameter​(java.lang.String name)
        Specified by:
        getParameter in interface javax.servlet.ServletRequest
        Overrides:
        getParameter in class javax.servlet.ServletRequestWrapper
      • getParameterMap

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

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

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

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

        public java.lang.String getHeader​(java.lang.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