Package com.appslandia.plum.base
Class RequestAccessor
- java.lang.Object
-
- javax.servlet.ServletRequestWrapper
-
- javax.servlet.http.HttpServletRequestWrapper
-
- com.appslandia.plum.base.RequestAccessor
-
- All Implemented Interfaces:
javax.servlet.http.HttpServletRequest,javax.servlet.ServletRequest
public class RequestAccessor extends javax.servlet.http.HttpServletRequestWrapper- Author:
- Loc Ha
-
-
Field Summary
Fields Modifier and Type Field Description static StringPARAM_ACTION_TYPE
-
Constructor Summary
Constructors Constructor Description RequestAccessor(javax.servlet.http.HttpServletRequest request)
-
Method Summary
-
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getHttpServletMapping, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getTrailerFields, 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, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, 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, wait, wait, wait
-
Methods inherited from interface javax.servlet.ServletRequest
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
-
-
-
-
Field Detail
-
PARAM_ACTION_TYPE
public static final String PARAM_ACTION_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
findParam
public <T> T findParam(String name, Class<T> targetType) throws IllegalArgumentException, com.appslandia.common.formatters.FormatterException
- Throws:
IllegalArgumentExceptioncom.appslandia.common.formatters.FormatterException
-
getParamValue
public <T> T getParamValue(String name, Class<T> targetType) throws IllegalArgumentException, com.appslandia.common.formatters.FormatterException
- Throws:
IllegalArgumentExceptioncom.appslandia.common.formatters.FormatterException
-
isGetOrHead
public boolean isGetOrHead()
-
isAjaxRequest
public boolean isAjaxRequest()
-
getIntPref
public int getIntPref(String name, int defaultValue)
-
getLongPref
public long getLongPref(String name, long defaultValue)
-
getLongPref
public double getLongPref(String name, double defaultValue)
-
getBoolPref
public boolean getBoolPref(String name, boolean defaultValue)
-
getActionType
public String getActionType()
-
isSaveAction
public boolean isSaveAction()
-
isSaveContAction
public boolean isSaveContAction()
-
isRemoveAction
public boolean isRemoveAction()
-
storeModel
public void storeModel(Object model)
-
storePagerModel
public void storePagerModel(PagerModel pagerModel)
-
storeSortBag
public void storeSortBag(SortBag sortBag)
-
isModuleAuthenticated
public boolean isModuleAuthenticated()
-
getUserPrincipal
public UserPrincipal getUserPrincipal()
- Specified by:
getUserPrincipalin interfacejavax.servlet.http.HttpServletRequest- Overrides:
getUserPrincipalin classjavax.servlet.http.HttpServletRequestWrapper
-
getRequiredPrincipal
public UserPrincipal getRequiredPrincipal()
-
getUserId
public int getUserId()
-
isUserInRoles
public boolean isUserInRoles(String... roles)
-
getRequestContext
public RequestContext getRequestContext()
-
getModelState
public ModelState getModelState()
-
getTempData
public TempData getTempData()
-
getMessages
public Messages getMessages()
-
getResources
public Resources getResources()
-
assertTrue
public void assertTrue(boolean expr) throws BadRequestException- Throws:
BadRequestException
-
assertNotNull
public <T> T assertNotNull(T value) throws BadRequestException- Throws:
BadRequestException
-
assertPositive
public void assertPositive(int value) throws BadRequestException- Throws:
BadRequestException
-
assertValidFields
public void assertValidFields(String... fieldNames) throws BadRequestException
- Throws:
BadRequestException
-
assertValidModel
public void assertValidModel() throws BadRequestException- Throws:
BadRequestException
-
assertInRoles
public void assertInRoles(String[] roles) throws ForbiddenException
- Throws:
ForbiddenException
-
assertForbidden
public void assertForbidden(boolean expr) throws ForbiddenException- Throws:
ForbiddenException
-
assertNotFound
public void assertNotFound(boolean expr) throws ForbiddenException- Throws:
ForbiddenException
-
-