| java.lang.Object org.apache.beehive.netui.util.internal.ServletUtils
ServletUtils | public class ServletUtils (Code) | | |
SESSION_MUTEX_ATTRIBUTE | final public static String SESSION_MUTEX_ATTRIBUTE(Code) | | |
dumpRequest | public static void dumpRequest(ServletRequest request, PrintStream output)(Code) | | Print parameters and attributes in the given request.
Parameters: request - the current HttpServletRequest. Parameters: output - a PrintStream to which to output request parameters and request/sessionattributes; if null, System.err is used. |
dumpServletContext | public static void dumpServletContext(ServletContext context, PrintStream output)(Code) | | Print attributes in the given ServletContext.
Parameters: context - the current ServletContext. Parameters: output - a PrintStream to which to output ServletContext attributes; if null,System.err is used. |
getBaseName | public static String getBaseName(String uri)(Code) | | Get the base filename of the given URI.
Parameters: uri - the URI from which to get the base filename. a String containing everything after the last slash of the given URI. |
getDirName | public static String getDirName(String uri)(Code) | | Get the directory path of the given URI.
Parameters: uri - the URI from which to get the directory path. a String containing everything before the last slash of the given URI. |
getSessionMutex | public static Object getSessionMutex(HttpSession httpSession, String attributeName)(Code) | | Returns a mutex object for the given
HttpSession that can be used
as a lock for a given session. For example, to synchronize lazy
initialization of session scoped objects.
The semantics for locking on an HttpSession object are unspecified, and
servlet containers are free to implement the HttpSession in such a way
that acquiring a lock on the HttpSession itself is not safe. When used
in conjunction with a HttpSessionListener (such as NetUI's
HttpSessionMutexListener) that puts a mutex object on the session when
the session is created, this method provides a lock that is 100% safe
to use across servlet containers. If a HttpSessionListener is not
registered in web.xml and there is no object for the given attribute name,
the HttpSession itself is returned as the next best lock.
Parameters: httpSession - the current session Parameters: attributeName - the attribute name of the mutex object on the session a mutex that can be used to serialize operations on the HttpSession |
preventCache | public static void preventCache(ServletResponse response)(Code) | | Set response headers to prevent caching of the response by the browser.
Parameters: response - the current ServletResponse |
throwServletException | public static void throwServletException(Throwable cause) throws ServletException(Code) | | This initializes the 'cause' on the exception before throwing it; otherwise, the chain of exceptions is hidden
because of legacy behavior in ServletException ('rootCause' vs. 'cause').
|
|
|