Package org.apache.hadoop.util
Class ServletUtil
java.lang.Object
org.apache.hadoop.util.ServletUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetParameter(javax.servlet.ServletRequest request, String name) Get a parameter from a ServletRequest.static StringgetRawPath(javax.servlet.http.HttpServletRequest request, String servletName) Parse the path component from the given request and return w/o decoding.static StringHTML footer to be added in the jsps.static PrintWriterInitial HTML header.static longparseLongParam(javax.servlet.ServletRequest request, String param) parseLongParam.
-
Field Details
-
HTML_TAIL
-
-
Constructor Details
-
ServletUtil
public ServletUtil()
-
-
Method Details
-
initHTML
public static PrintWriter initHTML(javax.servlet.ServletResponse response, String title) throws IOException Initial HTML header.- Parameters:
response- response.title- title.- Returns:
- PrintWriter.
- Throws:
IOException- raised on errors performing I/O.
-
getParameter
Get a parameter from a ServletRequest. Return null if the parameter contains only white spaces.- Parameters:
request- request.name- name.- Returns:
- get a parameter from a ServletRequest.
-
parseLongParam
public static long parseLongParam(javax.servlet.ServletRequest request, String param) throws IOException parseLongParam.- Parameters:
request- request.param- param.- Returns:
- a long value as passed in the given parameter, throwing an exception if it is not present or if it is not a valid number.
- Throws:
IOException- raised on errors performing I/O.
-
getRawPath
Parse the path component from the given request and return w/o decoding.- Parameters:
request- Http request to parseservletName- the name of servlet that precedes the path- Returns:
- path component, null if the default charset is not supported
-