public final class ExtDirectSpringUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static Charset |
UTF8_CHARSET |
| Modifier and Type | Method and Description |
|---|---|
static void |
addCacheHeaders(javax.servlet.http.HttpServletResponse response,
String etag,
Integer month)
Adds Expires, ETag and Cache-Control response headers.
|
static boolean |
equal(Object a,
Object b)
Checks if two objects are equal.
|
static String |
getStackTrace(Throwable t)
Converts a stacktrace into a String
|
static void |
handleCacheableResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
byte[] data,
String contentType)
Checks etag and sends back HTTP status 304 if not modified.
|
static Object |
invoke(org.springframework.context.ApplicationContext context,
String beanName,
MethodInfo methodInfo,
Object[] params)
Invokes a method on a Spring managed bean.
|
static Object |
invoke(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Locale locale,
org.springframework.context.ApplicationContext context,
ExtDirectRequest directRequest,
ParametersResolver parametersResolver) |
static boolean |
isMultipart(javax.servlet.http.HttpServletRequest request)
Checks if the request is a multipart request
|
public static final Charset UTF8_CHARSET
public static boolean equal(Object a, Object b)
a - object oneb - object twopublic static boolean isMultipart(javax.servlet.http.HttpServletRequest request)
request - the HTTP servlet requestpublic static Object invoke(org.springframework.context.ApplicationContext context, String beanName, MethodInfo methodInfo, Object[] params) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
context - a Spring application contextbeanName - the name of the beanmethodInfo - the methodInfo objectparams - the parametersIllegalArgumentException - if there is no bean in the contextIllegalAccessExceptionInvocationTargetExceptionpublic static Object invoke(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Locale locale, org.springframework.context.ApplicationContext context, ExtDirectRequest directRequest, ParametersResolver parametersResolver) throws Exception
Exceptionpublic static String getStackTrace(Throwable t)
t - a Throwablepublic static void addCacheHeaders(javax.servlet.http.HttpServletResponse response,
String etag,
Integer month)
response - the HTTP servlet responseetag - the calculated etag (md5) of the responsemonth - number of months the response can be cached. Added to the
Expires and Cache-Control header. If null defaults to 6
months.public static void handleCacheableResponse(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
byte[] data,
String contentType)
throws IOException
addCacheHeaders(HttpServletResponse, String, Integer)), writes
the data into the ServletResponse.getOutputStream() and
flushes it.request - the HTTP servlet requestresponse - the HTTP servlet responsedata - the response datacontentType - the content type of the data (i.e.
"application/javascript;charset=UTF-8")IOExceptionCopyright © 2010-2014. All Rights Reserved.