public class UtilAction extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
UtilAction.BadInputException |
| Constructor and Description |
|---|
UtilAction() |
| Modifier and Type | Method and Description |
|---|---|
static Integer |
checkIntegerField(javax.servlet.http.HttpServletRequest request,
org.apache.struts.action.ActionErrors errors,
String field,
String error)
Check if a field (in request) is an integer
|
static boolean |
checkRequiredField(javax.servlet.http.HttpServletRequest request,
org.apache.struts.action.ActionErrors errors,
String field,
String error)
Check if a field (in request) is present and not empty, otherwise add
an error in
errors container. |
static boolean |
getParameterBoolean(javax.servlet.http.HttpServletRequest request,
String name) |
static int |
getParameterInt(javax.servlet.http.HttpServletRequest request,
String name) |
static long |
getParameterLong(javax.servlet.http.HttpServletRequest request,
String name) |
static String |
getParameterString(javax.servlet.http.HttpServletRequest request,
String name) |
static boolean |
isEmptyParameter(javax.servlet.http.HttpServletRequest request,
String name) |
static boolean |
isNotEmptyParameter(javax.servlet.http.HttpServletRequest request,
String name) |
static Properties |
loadProperties(String propertiesPath) |
static BufferedImage |
scale(BufferedImage source,
int width,
int height)
Modification des tailles d'une image
|
public static int getParameterInt(javax.servlet.http.HttpServletRequest request,
String name)
throws UtilAction.BadInputException
UtilAction.BadInputExceptionpublic static long getParameterLong(javax.servlet.http.HttpServletRequest request,
String name)
throws UtilAction.BadInputException
UtilAction.BadInputExceptionpublic static boolean getParameterBoolean(javax.servlet.http.HttpServletRequest request,
String name)
throws UtilAction.BadInputException
UtilAction.BadInputExceptionpublic static String getParameterString(javax.servlet.http.HttpServletRequest request, String name) throws UtilAction.BadInputException
UtilAction.BadInputExceptionpublic static boolean isEmptyParameter(javax.servlet.http.HttpServletRequest request,
String name)
throws UtilAction.BadInputException
UtilAction.BadInputExceptionpublic static boolean isNotEmptyParameter(javax.servlet.http.HttpServletRequest request,
String name)
throws UtilAction.BadInputException
UtilAction.BadInputExceptionpublic static boolean checkRequiredField(javax.servlet.http.HttpServletRequest request,
org.apache.struts.action.ActionErrors errors,
String field,
String error)
errors container.request - current requesterrors - errors containerfield - field to checkerror - error i18n codetrue if field was found, flase otherwise.public static BufferedImage scale(BufferedImage source, int width, int height)
public static Integer checkIntegerField(javax.servlet.http.HttpServletRequest request, org.apache.struts.action.ActionErrors errors, String field, String error)
request - current requesterrors - errors containerfield - field to checkerror - error i18n codenull if field is not an integerpublic static Properties loadProperties(String propertiesPath)
Copyright © 2008-2013 Cybelia. All Rights Reserved.