|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.lateralnz.common.util.ServletUtils
public class ServletUtils
common utility functions used by servlets
| Field Summary | |
|---|---|
static java.lang.String |
XML_ATTRIBUTE
|
| Fields inherited from interface org.lateralnz.common.util.Constants |
|---|
AMPERSAND, AND, APPLICATION_X_WWW_FORM_URLENCODED, ASTERISK, AT, BACK_SLASH, CHAR_LEFT_CHEV, CHAR_RIGHT_CHEV, COLON, COMMA, DASH, DELETE, DOLLAR, DOT, DOT_CLASS, DOT_JAVA, EIGHT, EMPTY, EQUALS, FALSE, FILE_SEPARATOR, FIVE, FORWARD_SLASH, FOUR, FULLSTOP, HASH, HAT, INSERT, LEFT_BRACE, LEFT_BRACKET, LEFT_CHEV, MAX_LEN_APPCODE, MAX_LEN_APPGROUP, MAX_LEN_MSGCODE, MAX_LEN_MSGTEXT, MINUS_ONE, N, NEWLINE, NINE, NO, NULL_STRING, OFF, ON, ONE, ONE_DAY, ONE_HOUR, ONE_MINUTE, ONE_WEEK, PATH_SEPARATOR, PERCENT, PIPE, PLUS, QUESTION_MARK, QUOTE, REQUIRED, REQUIRES_NEW, RETURN, RIGHT_BRACE, RIGHT_BRACKET, RIGHT_CHEV, SELECT, SEMICOLON, SEVEN, SINGLE_QUOTE, SIX, SPACE, SQ_LEFT_BRACKET, SQ_RIGHT_BRACKET, SUPPORTS, TEXT_HTML, TEXT_PLAIN, TEXT_XML, THREE, TRUE, TWO, UNDERSCORE, UPDATE, UTF_8, Y, YES, ZERO |
| Constructor Summary | |
|---|---|
protected |
ServletUtils()
|
| Method Summary | |
|---|---|
static void |
forward(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
check if there is a forward parameter in the http request object, if so, forward on to it |
static void |
forward(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String forwardTag)
forward a servlet request, based upon a parameter with the name 'forward' |
static void |
forwardError(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
check if there is an error parameter in the http request object, if so, forward on to it |
static java.lang.String |
getAttrOrParam(javax.servlet.http.HttpServletRequest request,
java.lang.String name)
get a named attribute, and if it is not found, look for the parameter instead |
static java.io.BufferedReader |
getBufferedReaderForURL(java.lang.String urlstr,
java.util.Map headers,
java.lang.String encoding)
|
static java.io.BufferedReader |
getBufferedReaderForURL(java.lang.String urlstr,
java.lang.String encoding)
get a buffered reader for reading from a specific URL |
static java.lang.String |
getContent(java.lang.String httpmessage)
|
static java.lang.String |
getHeader(java.lang.String httpmessage)
|
static java.lang.String[] |
getLanguageCountry(java.lang.String acceptlang)
|
static java.util.Locale |
getLocale(javax.servlet.http.HttpServletRequest request)
|
static java.util.Locale |
getLocale(javax.servlet.http.HttpServletRequest request,
java.lang.String variant,
boolean sessionset)
get the locale being used by this request |
static java.lang.String |
getParameterFromMap(java.util.Map parameterMap,
java.lang.String key,
int index)
|
static java.lang.String |
getServerResponse(java.lang.String host,
int port,
java.lang.String request,
java.lang.String encoding,
int timeout)
|
static java.lang.String |
getServerResponse(java.lang.String url,
java.util.Map headers,
java.lang.String encoding)
call another server and return its response as a string |
static void |
main(java.lang.String[] args)
|
static void |
setLocale(javax.servlet.http.HttpSession session,
java.util.Locale locale)
set the locale for this session |
static java.util.Properties |
toProperties(javax.servlet.ServletConfig config)
convert a servlet config into a properties file |
static java.lang.String |
toString(javax.servlet.http.HttpServletRequest request)
convert a servlet request to a string (for debugging purposes) |
static java.lang.String |
toString(javax.servlet.http.HttpSession session)
|
static java.lang.String |
toString(java.util.Map queryMap)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String XML_ATTRIBUTE
| Constructor Detail |
|---|
protected ServletUtils()
| Method Detail |
|---|
public static final void forward(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String forwardTag)
public static final void forward(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
request - the servlet requestresponse - the servlet response
public static final void forwardError(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
request - the servlet requestresponse - the servlet response
public static final java.lang.String getAttrOrParam(javax.servlet.http.HttpServletRequest request,
java.lang.String name)
public static final java.io.BufferedReader getBufferedReaderForURL(java.lang.String urlstr,
java.lang.String encoding)
throws java.net.MalformedURLException,
java.io.IOException
java.net.MalformedURLException
java.io.IOException
public static final java.io.BufferedReader getBufferedReaderForURL(java.lang.String urlstr,
java.util.Map headers,
java.lang.String encoding)
throws java.net.MalformedURLException,
java.io.IOException
java.net.MalformedURLException
java.io.IOExceptionpublic static final java.lang.String getContent(java.lang.String httpmessage)
public static final java.lang.String getHeader(java.lang.String httpmessage)
public static final java.lang.String[] getLanguageCountry(java.lang.String acceptlang)
public static final java.util.Locale getLocale(javax.servlet.http.HttpServletRequest request)
public static final java.util.Locale getLocale(javax.servlet.http.HttpServletRequest request,
java.lang.String variant,
boolean sessionset)
public static final java.lang.String getServerResponse(java.lang.String url,
java.util.Map headers,
java.lang.String encoding)
throws java.net.MalformedURLException,
java.io.IOException
java.net.MalformedURLException
java.io.IOException
public static java.lang.String getParameterFromMap(java.util.Map parameterMap,
java.lang.String key,
int index)
public static final java.lang.String getServerResponse(java.lang.String host,
int port,
java.lang.String request,
java.lang.String encoding,
int timeout)
throws java.io.IOException
java.io.IOException
public static final void setLocale(javax.servlet.http.HttpSession session,
java.util.Locale locale)
public static final java.util.Properties toProperties(javax.servlet.ServletConfig config)
public static final java.lang.String toString(javax.servlet.http.HttpServletRequest request)
public static final java.lang.String toString(javax.servlet.http.HttpSession session)
public static final java.lang.String toString(java.util.Map queryMap)
public static final void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||