Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jboss.weld.context;
 
 import java.util.Map;
 
 import  javax.servlet.ServletRequest;
 

The built in request context is associated with RequestScoped and is a managed context which can be activated, invalidated and deactivated.

Weld comes with four implementation of the request context. The HttpRequestContext, in which conversations are bound to the ServletRequest, can be injected:

 @Inject @Http RequestContext requestContext;
 

Alternatively the BoundRequestContext in which requests are bound a Map can be injected:

 @Inject &#064B;und RequestContext requestContext;
 

Additionally, Weld provides an unbound request context (which is automatially bound to the thread) which can be injected:

 @Inject @Unbound RequestContext requestContext;
 

Finally, Weld provides a request context which is bound to an InvocationContext and can be injected:

 @Inject &#064E;b RequestContext requestContext;
 

Author(s):
Pete Muir
See also:
BoundRequestContext
HttpRequestContext
EjbRequestContext
RequestScoped
public interface RequestContext extends ManagedContext {
New to GrepCode? Check out our FAQ X