List of usage examples for javax.servlet ServletRequest getAttribute
public Object getAttribute(String name);
Object
, or null
if no attribute of the given name exists. From source file:grails.plugins.jaxrs.web.JaxrsUtils.java
/** * Obtains the request URI that has been previously been stored via * {@link #setRequestUriAttribute(ServletRequest, String)} from a * <code>request</code>.//from w w w . jav a2s.c o m * * @param request * request where to obtain the URI from. * @return request URI. */ public static String getRequestUriAttribute(ServletRequest request) { return (String) request.getAttribute(REQUEST_URI_ATTRIBUTE_NAME); }
From source file:com.opensymphony.able.filter.TransactionServletFilter.java
public static TransactionOutcome getTransactionOutcome(ServletRequest request) { return (TransactionOutcome) request.getAttribute(TRANSACTION_OUTCOME); }
From source file:com.boylesoftware.web.RouterRequestLifecycle.java
/** * Get router request associated with the container request. * * @param request Container request.//from w w w. ja v a 2 s .c o m * * @return Associated router request, or {@code null}. */ static RouterRequest restore(final ServletRequest request) { return (RouterRequest) request.getAttribute(ROUTER_REQ_ATTNAME); }
From source file:com.vmware.identity.sts.util.MessageExtractionUtil.java
/** * Parse the servlet request to get the user name * @param req/*from ww w. j a v a2 s. co m*/ * @return */ public static String extractUsernameFromSevletRequest(ServletRequest req) { Validate.notNull(req); SecurityHeaderType secHdr = (SecurityHeaderType) req.getAttribute(WsConstants.SECURITY_HEADER_KEY); assert secHdr != null; return extractUsernameFromSecurityHeader(secHdr); }
From source file:net.sourceforge.vulcan.web.ContentTypeFilter.java
public static boolean isContentTypeSupressionEnabled(ServletRequest request) { Boolean value = (Boolean) request.getAttribute(ATTR_DISABLE_SUPPRESSION); return value == null || Boolean.FALSE.equals(value); }
From source file:org.opencms.ade.detailpage.CmsDetailPageResourceHandler.java
/** * Returns the current detail content resource, or <code>null</code> if this is not a request to a content detail page.<p> * /* w w w .j a v a 2 s . com*/ * @param req the current request * * @return the current detail content resource, or <code>null</code> if this is not a request to a content detail page */ public static CmsResource getDetailResource(ServletRequest req) { return (CmsResource) req.getAttribute(ATTR_DETAIL_CONTENT_RESOURCE); }
From source file:org.apache.struts2.dispatcher.ActionContextCleanUp.java
/** * Clean up the request of threadlocals if this is the last execution * * @param req The servlet request//from ww w.java 2s. com */ protected static void cleanUp(ServletRequest req) { // should we clean up yet? Integer count = (Integer) req.getAttribute(COUNTER); if (count != null && count > 0) { if (LOG.isDebugEnabled()) { LOG.debug("skipping cleanup counter=" + count); } return; } // always dontClean up the thread request, even if an action hasn't been executed ActionContext.setContext(null); Dispatcher.setInstance(null); }
From source file:edu.cornell.mannlib.vitro.webapp.auth.policy.RequestPolicyList.java
/** * Get the current list of policy additions from the request, or create one * if there is none. This method may return an empty list, but it never * returns null./*from w ww. j a v a 2 s.c o m*/ */ private static PolicyList getPoliciesFromRequest(ServletRequest request) { if (request == null) { throw new NullPointerException("request may not be null."); } Object obj = request.getAttribute(ATTRIBUTE_POLICY_ADDITIONS); if (obj == null) { obj = new PolicyList(); request.setAttribute(ATTRIBUTE_POLICY_ADDITIONS, obj); } if (!(obj instanceof PolicyList)) { throw new IllegalStateException("Expected to find an instance of " + PolicyList.class.getName() + " in the context, but found an instance of " + obj.getClass().getName() + " instead."); } return (PolicyList) obj; }
From source file:filters.ActionValidationFilter.java
/** Static method to check validity of the sent credential. * @param request/*from www. j av a 2 s . c o m*/ * @return <true> iff ckey is valid */ public static boolean isValidCkey(final ServletRequest request) { final Boolean validCredential = (Boolean) request.getAttribute(REQUEST_ATTRIB_VALID_CREDENTIAL); return validCredential != null && validCredential; }
From source file:net.ontopia.topicmaps.nav2.utils.FrameworkUtils.java
/** * INTERNAL: Gets the context tag from the request. *///from w w w . j a va 2 s .c o m public static ContextTag getContextTag(ServletRequest request) { return (ContextTag) request.getAttribute(NavigatorApplicationIF.CONTEXT_KEY); }