| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Miscellaneous utilities for web applications. Used by various framework classes.
| Field Summary | |
final static String | DEFAULT_WEB_APP_ROOT_KEYDefault web app root key: "webapp.root" |
final static String[] | SUBMIT_IMAGE_SUFFIXESName suffixes in case of image buttons |
final static String | TEMP_DIR_CONTEXT_ATTRIBUTEStandard Servlet spec context attribute that specifies a temporary directory for the current web application, of type java.io.File |
final static String | WEB_APP_ROOT_KEY_PARAMWeb app root key parameter at the servlet context level (i.e. |
| Method Summary | |
static Cookie | getCookie(HttpServletRequest request, String name)Retrieve the first cookie with the given name. |
static Object | getOrCreateSessionAttribute(HttpServletRequest request, String name, Class clazz)Get the specified session attribute, creating and setting a new attribute if no existing found. |
static Map | getParametersStartingWith(ServletRequest request, String base)Convenience method to return a map from un-prefixed property names to values. |
static Object | getSessionAttribute(HttpServletRequest request, String name)Check the given request for a session attribute of the given name. |
static File | getTempDir(ServletContext servletContext)Return the temporary directory for the current web application, as provided by the servlet container. |
static boolean | hasSubmitParameter(ServletRequest request, String name)Checks if a specific input type="submit" parameter was sent in the request, either via a button (directly with name) or via an image (name + ".x" or name + ".y"). |
static void | setSessionAttribute(HttpServletRequest request, String name, Object value)Set the session attribute with the given name to the given value. |
static void | setWebAppRootSystemProperty(ServletContext servletContext)Set a system property to the web application root directory. |
| Field Detail |
public final static String DEFAULT_WEB_APP_ROOT_KEY
public final static String[] SUBMIT_IMAGE_SUFFIXES
public final static String TEMP_DIR_CONTEXT_ATTRIBUTE
public final static String WEB_APP_ROOT_KEY_PARAM
| Method Detail |
public static Cookie getCookie(HttpServletRequest request, String name)
public static Object getOrCreateSessionAttribute(HttpServletRequest request, String name, Class clazz)
throws ServletException
public static Map getParametersStartingWith(ServletRequest request, String base)
public static Object getSessionAttribute(HttpServletRequest request, String name)
public static File getTempDir(ServletContext servletContext)
public static boolean hasSubmitParameter(ServletRequest request, String name)
public static void setSessionAttribute(HttpServletRequest request, String name, Object value)
public static void setWebAppRootSystemProperty(ServletContext servletContext)
throws java.lang.IllegalStateException
Can be used for toolkits that support substition with System.getProperty values, like Log4J's "${key}" syntax within log file locations.
| Association Links |
to Class java.lang.String
to Class java.lang.String
to Class java.lang.String
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||