|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Qualifier @Target(value={TYPE,METHOD,PARAMETER,FIELD}) @Retention(value=RUNTIME) @Documented public @interface HeaderParam
Qualifies injection points that should have their values fetched from a corresponding HTTP header.
Example usage:
@Inject @HeaderParam("Cache-Control") private String cacheControl;
Example usage with default value
@Inject @HeaderParam("Cache-Control") @DefaultValue("no-cache") private String cacheControl;
Because the bean produced is dependent-scoped, use of this annotation on class fields and bean properties is only safe for request-scoped beans. Beans with longer scopes should wrap this bean in a provider and retrieve the value on demand.
@Inject @HeaderParam("Cache-Control") private Instance<String> cacheControlProvider; ... String cacheControl = cacheControlProvider.get();
Optional Element Summary | |
---|---|
String |
value
|
public abstract String value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |