| Modifier and Type | Field and Description |
|---|---|
static String |
ACTION_INDEX |
static String |
PARAM_RETURN_URL |
static String |
PARAM_SERVER_NAME |
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 StringBuilder |
appendUriQuery(javax.servlet.http.HttpServletRequest request,
StringBuilder sb) |
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 path) |
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 StringBuilder |
getClientBuilder(javax.servlet.http.HttpServletRequest request,
StringBuilder builder) |
static String |
getClientIp(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 String |
getInitParam(javax.servlet.FilterConfig config,
String paramName,
String defaultValue) |
static String |
getInitParam(javax.servlet.ServletConfig config,
String paramName,
String defaultValue) |
static String |
getInitParam(javax.servlet.ServletContext sc,
String paramName,
String defaultValue) |
static StringBuilder |
getLoginUrl(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 path) |
static String |
getRequestUrl(javax.servlet.http.HttpServletRequest request) |
static String |
getRequestUrl(javax.servlet.http.HttpServletRequest request,
String pathLang) |
static UserPrincipal |
getRequiredPrincipal(javax.servlet.http.HttpServletRequest request) |
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 |
getUriQuery(javax.servlet.http.HttpServletRequest request) |
static UserPrincipal |
getUserPrincipal(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 path) |
static boolean |
isAjaxRequest(javax.servlet.http.HttpServletRequest request) |
static boolean |
isGzipAccepted(javax.servlet.http.HttpServletRequest request) |
static boolean |
isLocalhost(String serverName) |
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 StringBuilder |
newUrlBuilder() |
static String |
parseLanguage(javax.servlet.http.HttpServletRequest request,
Collection<String> supportedLanguages) |
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 |
toEtag(byte[] md5) |
static String |
toEtag(Object... args) |
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 REQUEST_ATTRIBUTE_MODEL
public static final String PARAM_RETURN_URL
public static final String PARAM_SERVER_NAME
public static StringBuilder newUrlBuilder()
public static String getUriQuery(javax.servlet.http.HttpServletRequest request)
public static StringBuilder appendUriQuery(javax.servlet.http.HttpServletRequest request, StringBuilder sb)
public static StringBuilder getLoginUrl(javax.servlet.http.HttpServletRequest request)
public static String getSecureUrl(javax.servlet.http.HttpServletRequest request, int httpsPort)
public static String getRequestUrl(javax.servlet.http.HttpServletRequest request)
public static String getRequestUrl(javax.servlet.http.HttpServletRequest request, String pathLang)
public static StringBuilder getClientBuilder(javax.servlet.http.HttpServletRequest request, StringBuilder builder)
public static String getClientIp(javax.servlet.http.HttpServletRequest request)
public static boolean isLocalhost(String serverName) throws IllegalArgumentException
IllegalArgumentExceptionpublic static String getAppDir(javax.servlet.ServletContext sc)
public static boolean isGzipAccepted(javax.servlet.http.HttpServletRequest request)
public static boolean isAjaxRequest(javax.servlet.http.HttpServletRequest request)
public static void setContentDisposition(javax.servlet.http.HttpServletResponse response,
String fileName,
boolean inline)
public static String parseLanguage(javax.servlet.http.HttpServletRequest request, Collection<String> supportedLanguages)
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 path)
public static void forward(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String path)
throws javax.servlet.ServletException,
IOException
javax.servlet.ServletExceptionIOExceptionpublic static void include(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String path)
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 toEtag(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 UserPrincipal getRequiredPrincipal(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 String getInitParam(javax.servlet.FilterConfig config, String paramName, String defaultValue)
public static String getInitParam(javax.servlet.ServletConfig config, String paramName, String defaultValue)
public static String getInitParam(javax.servlet.ServletContext sc, String paramName, String defaultValue)
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 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 © 2021. All rights reserved.