@InterfaceAudience.Private @InterfaceStability.Unstable public class ServletUtil extends Object
Constructor and Description |
---|
ServletUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
encodePath(String path)
Escape and encode a string regarded as the path component of an URI.
|
static String |
encodeQueryValue(String value)
Escape and encode a string regarded as within the query component of an URI.
|
static String |
getDecodedPath(javax.servlet.http.HttpServletRequest request,
String servletName)
Parse and decode the path component from the given request.
|
static String |
getParameter(javax.servlet.ServletRequest request,
String name)
Get a parameter from a ServletRequest.
|
static String |
getRawPath(javax.servlet.http.HttpServletRequest request,
String servletName)
Parse the path component from the given request and return w/o decoding.
|
static String |
htmlFooter()
HTML footer to be added in the jsps.
|
static PrintWriter |
initHTML(javax.servlet.ServletResponse response,
String title)
Initial HTML header
|
static long |
parseLongParam(javax.servlet.ServletRequest request,
String param) |
static String |
percentageGraph(float perc,
int width)
Generate the percentage graph and returns HTML representation string
of the same.
|
static String |
percentageGraph(int perc,
int width)
Generate the percentage graph and returns HTML representation string
of the same.
|
public static final String HTML_TAIL
public static PrintWriter initHTML(javax.servlet.ServletResponse response, String title) throws IOException
IOException
public static String getParameter(javax.servlet.ServletRequest request, String name)
public static long parseLongParam(javax.servlet.ServletRequest request, String param) throws IOException
IOException
public static String htmlFooter()
public static String percentageGraph(int perc, int width) throws IOException
perc
- The percentage value for which graph is to be generatedwidth
- The width of the display tableIOException
public static String percentageGraph(float perc, int width) throws IOException
perc
- The percentage value for which graph is to be generatedwidth
- The width of the display tableIOException
public static String encodeQueryValue(String value)
value
- the value to encodepublic static String encodePath(String path)
path
- the path component to encodepublic static String getDecodedPath(javax.servlet.http.HttpServletRequest request, String servletName)
request
- Http request to parseservletName
- the name of servlet that precedes the pathpublic static String getRawPath(javax.servlet.http.HttpServletRequest request, String servletName)
request
- Http request to parseservletName
- the name of servlet that precedes the pathCopyright © 2013 Apache Software Foundation. All rights reserved.