|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mindoo.xpages2eclipse.tools.ServletHelper
public class ServletHelper
Helper methods for servlet I/O operations
Constructor Summary | |
---|---|
ServletHelper()
|
Method Summary | |
---|---|
static double |
getParamDouble(HttpServletRequest req,
java.lang.String param,
double defaultValue)
Convenience method to read a double value from the query string |
static int |
getParamInt(HttpServletRequest req,
java.lang.String param,
int defaultValue)
Convenience method to read an int value from the query string |
static java.lang.String |
getParamString(HttpServletRequest req,
java.lang.String param,
java.lang.String defaultValue)
Convenience method to read a String value from the query string |
static java.lang.String |
readPostDataAsText(HttpServletRequest req)
This method reads POST data that contains character data |
static void |
sendHttpError(HttpServletResponse response,
int errCode,
java.lang.String errMsg,
java.lang.Throwable t)
Sends a http error code to the specified HttpServletResponse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServletHelper()
Method Detail |
---|
public static java.lang.String readPostDataAsText(HttpServletRequest req) throws java.io.IOException
req
- servlet request
java.io.IOException
public static void sendHttpError(HttpServletResponse response, int errCode, java.lang.String errMsg, java.lang.Throwable t)
HttpServletResponse
response
- servlet responseerrCode
- e.g. 404 or 500errMsg
- error message, can be null
t
- an optional exception, can be null
ServletException
java.io.IOException
public static int getParamInt(HttpServletRequest req, java.lang.String param, int defaultValue)
req
- servlet requestparam
- query string parameter namedefaultValue
- default value of parameter is not defined
public static double getParamDouble(HttpServletRequest req, java.lang.String param, double defaultValue)
req
- servlet requestparam
- query string parameter namedefaultValue
- default value of parameter is not defined
public static java.lang.String getParamString(HttpServletRequest req, java.lang.String param, java.lang.String defaultValue)
req
- servlet requestparam
- query string parameter namedefaultValue
- default value of parameter is not defined
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |