org.jboss.solder.servlet.http
Annotation Type CookieParam


@Qualifier
@Target(value={TYPE,METHOD,PARAMETER,FIELD})
@Retention(value=RUNTIME)
@Documented
public @interface CookieParam

Qualifies injection points that should have their values fetched from a corresponding Cookie.

Example usage:

 @Inject
 @CookieParam("lang")
 private String lang;
 

Example usage with default value

 @Inject
 @CookieParam("lang")
 @DefaultValue("en")
 private String lang;
 

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 @CookieParam("lang")
 private Instance<String> langProvider;

 ...

 String lang = langProvider.get();
 

Author:
Dan Allen

Optional Element Summary
 String value
           
 

value

public abstract String value
Default:
""


Copyright © 2011 Seam Framework. All Rights Reserved.