Package com.jalios.jcms.ajax
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
-
-
Constructor Summary
Constructors Constructor Description AjaxRequestWrapper(javax.servlet.http.HttpServletRequest req, JcmsJspAjaxContext jjac)
-
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 mapjava.lang.String
getOriginalPathInfo()
Retrieve the path info of the origina unwrapped requestjava.lang.String
getOriginalServletPath()
Retrieve the servlet path of the origina unwrapped requestjava.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 attributesvoid
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 propertychannel.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 interfacejavax.servlet.http.HttpServletRequest
- Overrides:
getRequestURI
in classjavax.servlet.http.HttpServletRequestWrapper
-
getContextPath
public java.lang.String getContextPath()
- Specified by:
getContextPath
in interfacejavax.servlet.http.HttpServletRequest
- Overrides:
getContextPath
in classjavax.servlet.http.HttpServletRequestWrapper
-
getPathInfo
public java.lang.String getPathInfo()
- Specified by:
getPathInfo
in interfacejavax.servlet.http.HttpServletRequest
- Overrides:
getPathInfo
in classjavax.servlet.http.HttpServletRequestWrapper
-
getPathTranslated
public java.lang.String getPathTranslated()
- Specified by:
getPathTranslated
in interfacejavax.servlet.http.HttpServletRequest
- Overrides:
getPathTranslated
in classjavax.servlet.http.HttpServletRequestWrapper
-
getQueryString
public java.lang.String getQueryString()
- Specified by:
getQueryString
in interfacejavax.servlet.http.HttpServletRequest
- Overrides:
getQueryString
in classjavax.servlet.http.HttpServletRequestWrapper
-
getServletPath
public java.lang.String getServletPath()
- Specified by:
getServletPath
in interfacejavax.servlet.http.HttpServletRequest
- Overrides:
getServletPath
in classjavax.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 interfacejavax.servlet.ServletRequest
- Overrides:
getLocale
in classjavax.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 interfacejavax.servlet.ServletRequest
- Overrides:
getParameter
in classjavax.servlet.ServletRequestWrapper
-
getParameterMap
public java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
- Specified by:
getParameterMap
in interfacejavax.servlet.ServletRequest
- Overrides:
getParameterMap
in classjavax.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 interfacejavax.servlet.ServletRequest
- Overrides:
getParameterNames
in classjavax.servlet.ServletRequestWrapper
-
getParameterValues
public java.lang.String[] getParameterValues(java.lang.String name)
- Specified by:
getParameterValues
in interfacejavax.servlet.ServletRequest
- Overrides:
getParameterValues
in classjavax.servlet.ServletRequestWrapper
-
getHeader
public java.lang.String getHeader(java.lang.String name)
- Specified by:
getHeader
in interfacejavax.servlet.http.HttpServletRequest
- Overrides:
getHeader
in classjavax.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
-
-