| Modifier and Type | Field and Description |
|---|---|
static String |
ACTION_INDEX |
static String |
PARAM_RETURN_URL |
static String |
REQUEST_ATTRIBUTE_MODEL |
| Constructor and Description |
|---|
ServletUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addError(javax.servlet.http.HttpServletRequest request,
String fieldName,
String msgKey) |
static void |
addError(javax.servlet.http.HttpServletRequest request,
String fieldName,
String msgKey,
Map<String,Object> msgParams) |
static boolean |
allowContentType(String contentType,
String allowType) |
static javax.servlet.http.HttpServletResponse |
assertNotCommitted(javax.servlet.http.HttpServletResponse response) |
static boolean |
checkNotModified(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
long lastModifiedMs) |
static boolean |
checkNotModified(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String etag) |
static boolean |
checkPrecondition(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
long lastModifiedMs) |
static boolean |
checkPrecondition(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String etag) |
static void |
forward(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String location) |
static String |
generateEtag(byte[] md5) |
static String |
getAppDir(javax.servlet.ServletContext sc) |
static <T> T |
getAppScoped(javax.servlet.http.HttpServletRequest request,
Class<T> beanType) |
static <T> T |
getAppScoped(javax.servlet.ServletContext sc,
Class<T> beanType) |
static String |
getClientIpInfo(javax.servlet.http.HttpServletRequest request) |
static String |
getCookiePath(javax.servlet.ServletContext sc) |
static String |
getCookieValue(javax.servlet.http.HttpServletRequest request,
String name) |
static com.appslandia.common.base.FormatProvider |
getFormatProvider(javax.servlet.http.HttpServletRequest request) |
static StringBuilder |
getFormLoginUrl(javax.servlet.http.HttpServletRequest request) |
static Messages |
getMessages(javax.servlet.http.HttpServletRequest request) |
static ModelState |
getModelState(javax.servlet.http.HttpServletRequest request) |
static Object |
getMutex(javax.servlet.http.HttpSession session) |
static Object |
getMutex(javax.servlet.ServletContext context) |
static PrefCookie |
getPrefCookie(javax.servlet.http.HttpServletRequest request) |
static PrintWriter |
getPrintWriter(javax.servlet.http.HttpServletResponse response) |
static RequestContext |
getRequestContext(javax.servlet.http.HttpServletRequest request) |
static javax.servlet.RequestDispatcher |
getRequestDispatcher(javax.servlet.http.HttpServletRequest request,
String location) |
static Resources |
getResources(javax.servlet.http.HttpServletRequest request) |
static String |
getSecureUrl(javax.servlet.http.HttpServletRequest request,
int httpsPort) |
static TempData |
getTempData(javax.servlet.http.HttpServletRequest request) |
static String |
getUriAndQuery(javax.servlet.http.HttpServletRequest request) |
static UserPrincipal |
getUserPrincipal(javax.servlet.http.HttpServletRequest request) |
static ViewBag |
getViewBag(javax.servlet.http.HttpServletRequest request) |
static Writer |
getWriter(javax.servlet.http.HttpServletResponse response) |
static void |
include(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String location) |
static boolean |
isGzipAccepted(javax.servlet.http.HttpServletRequest request) |
static boolean |
isLocal(javax.servlet.http.HttpServletRequest request) |
static boolean |
loadProps(javax.servlet.ServletContext sc,
String resourcePath,
Properties props) |
static boolean |
loadProps(javax.servlet.ServletContext sc,
String resourcePath,
com.appslandia.common.base.PropertyConfig config) |
static Object |
removeAttribute(javax.servlet.http.HttpServletRequest request,
String attribute) |
static void |
removeCookie(javax.servlet.http.HttpServletResponse response,
String name,
String domain,
String path) |
static void |
sendRedirect(javax.servlet.http.HttpServletResponse response,
String location,
int status) |
static void |
setContentDisposition(javax.servlet.http.HttpServletResponse response,
String fileName,
boolean inline) |
static void |
setWWWAuthenticate(javax.servlet.http.HttpServletResponse response,
String authType,
String realmName) |
static String |
toWrapperPath(javax.servlet.http.HttpServletRequest request) |
static String |
toWrapperPath(javax.servlet.http.HttpServletResponse response) |
static <T> T |
unwrapRequest(javax.servlet.http.HttpServletRequest request,
Class<T> toImpl) |
static <T> T |
unwrapResponse(javax.servlet.http.HttpServletResponse response,
Class<T> toImpl) |
public static final String ACTION_INDEX
public static final String PARAM_RETURN_URL
public static final String REQUEST_ATTRIBUTE_MODEL
public static String getUriAndQuery(javax.servlet.http.HttpServletRequest request)
public static StringBuilder getFormLoginUrl(javax.servlet.http.HttpServletRequest request)
public static String getSecureUrl(javax.servlet.http.HttpServletRequest request, int httpsPort)
public static String getClientIpInfo(javax.servlet.http.HttpServletRequest request)
public static boolean isLocal(javax.servlet.http.HttpServletRequest request)
public static String getAppDir(javax.servlet.ServletContext sc)
public static boolean isGzipAccepted(javax.servlet.http.HttpServletRequest request)
public static void setContentDisposition(javax.servlet.http.HttpServletResponse response,
String fileName,
boolean inline)
public static Object getMutex(javax.servlet.http.HttpSession session)
public static Object getMutex(javax.servlet.ServletContext context)
public static Writer getWriter(javax.servlet.http.HttpServletResponse response) throws IOException
IOExceptionpublic static PrintWriter getPrintWriter(javax.servlet.http.HttpServletResponse response) throws IOException
IOExceptionpublic static javax.servlet.http.HttpServletResponse assertNotCommitted(javax.servlet.http.HttpServletResponse response)
throws IllegalStateException
IllegalStateExceptionpublic static javax.servlet.RequestDispatcher getRequestDispatcher(javax.servlet.http.HttpServletRequest request,
String location)
public static void forward(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String location)
throws javax.servlet.ServletException,
IOException
javax.servlet.ServletExceptionIOExceptionpublic static void include(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String location)
throws javax.servlet.ServletException,
IOException
javax.servlet.ServletExceptionIOExceptionpublic static void sendRedirect(javax.servlet.http.HttpServletResponse response,
String location,
int status)
throws IllegalStateException
IllegalStateExceptionpublic static String toWrapperPath(javax.servlet.http.HttpServletRequest request)
public static String toWrapperPath(javax.servlet.http.HttpServletResponse response)
public static <T> T unwrapRequest(javax.servlet.http.HttpServletRequest request,
Class<T> toImpl)
public static <T> T unwrapResponse(javax.servlet.http.HttpServletResponse response,
Class<T> toImpl)
public static String getCookieValue(javax.servlet.http.HttpServletRequest request, String name)
public static void removeCookie(javax.servlet.http.HttpServletResponse response,
String name,
String domain,
String path)
public static String getCookiePath(javax.servlet.ServletContext sc)
public static String generateEtag(byte[] md5)
public static boolean checkNotModified(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
long lastModifiedMs)
public static boolean checkNotModified(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String etag)
public static boolean checkPrecondition(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
long lastModifiedMs)
public static boolean checkPrecondition(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String etag)
public static UserPrincipal getUserPrincipal(javax.servlet.http.HttpServletRequest request)
public static void setWWWAuthenticate(javax.servlet.http.HttpServletResponse response,
String authType,
String realmName)
public static Object removeAttribute(javax.servlet.http.HttpServletRequest request, String attribute)
public static RequestContext getRequestContext(javax.servlet.http.HttpServletRequest request)
public static ModelState getModelState(javax.servlet.http.HttpServletRequest request)
public static Messages getMessages(javax.servlet.http.HttpServletRequest request)
public static TempData getTempData(javax.servlet.http.HttpServletRequest request)
public static ViewBag getViewBag(javax.servlet.http.HttpServletRequest request)
public static PrefCookie getPrefCookie(javax.servlet.http.HttpServletRequest request)
public static Resources getResources(javax.servlet.http.HttpServletRequest request)
public static com.appslandia.common.base.FormatProvider getFormatProvider(javax.servlet.http.HttpServletRequest request)
public static void addError(javax.servlet.http.HttpServletRequest request,
String fieldName,
String msgKey)
public static void addError(javax.servlet.http.HttpServletRequest request,
String fieldName,
String msgKey,
Map<String,Object> msgParams)
public static <T> T getAppScoped(javax.servlet.http.HttpServletRequest request,
Class<T> beanType)
public static <T> T getAppScoped(javax.servlet.ServletContext sc,
Class<T> beanType)
public static boolean loadProps(javax.servlet.ServletContext sc,
String resourcePath,
Properties props)
throws IOException
IOExceptionpublic static boolean loadProps(javax.servlet.ServletContext sc,
String resourcePath,
com.appslandia.common.base.PropertyConfig config)
throws IOException
IOExceptionCopyright © 2019. All rights reserved.