@Qualifier @Target(value={TYPE,METHOD,PARAMETER,FIELD}) @Retention(value=RUNTIME) @Documented public @interface RequestParam
Example explicit usage, assuming a servlet path /book.jsf?id=3
@Inject
@RequestParam("id")
private String bookId;
Example implicit usage, assuming the same servlet path
@Inject @RequestParam private String id;
Example explicit usage with default value
@Inject
@RequestParam("id")
@DefaultValue("1")
private String bookId;
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 @RequestParam("id")
private Instance<String> bookIdProvider;
...
String bookId = bookIdProvider.get();
public abstract String value
Copyright © 2012 Seam Framework. All Rights Reserved.