|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.evanmclean.evlib.servlet.ServletUtils
public final class ServletUtils
Various utility functions for servlets.
| Method Summary | |
|---|---|
static int |
getIntParameter(ServletRequest req,
String name,
int def)
Get the parameter from the request, trimming it and coverting to an integer. |
static String |
getParameter(ServletRequest req,
String name)
Get the parameter from the request, trimming it and returning an empty string if it doesn't exist. |
static String |
getParameter(ServletRequest req,
String name,
String def)
Get the parameter from the request, trimming it, and if blank then return the specified default value. |
static File |
getTempDir(GenericServlet servlet)
Get the directory where the servlet can put temporary files. |
static File |
getTempDir(Servlet servlet)
Get the directory where the servlet can put temporary files. |
static File |
getTempDir(ServletConfig servlet_config)
Get the directory where the servlet can put temporary files. |
static File |
getTempDir(ServletContext servlet_context)
Get the directory where the servlet can put temporary files. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static int getIntParameter(ServletRequest req,
String name,
int def)
req - The request object.name - The name of the parameter.def - The default value to return if the parameter is not a valid number.
public static String getParameter(ServletRequest req,
String name)
req - The request object.name - The name of the parameter.
public static String getParameter(ServletRequest req,
String name,
String def)
req - The request object.name - The name of the parameter.def - The default to return if the parameter is blank.
public static File getTempDir(GenericServlet servlet)
throws ServletException
servlet -
ServletException - An error occurred getting the temporary directory.
public static File getTempDir(Servlet servlet)
throws ServletException
servlet -
ServletException - An error occurred getting the temporary directory.
public static File getTempDir(ServletConfig servlet_config)
throws ServletException
servlet_config -
ServletException - An error occurred getting the temporary directory.
public static File getTempDir(ServletContext servlet_context)
throws ServletException
servlet_context -
ServletException - An error occurred getting the temporary directory.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||