javax.ws.rs
Annotation Type HeaderParam
@Target(value=PARAMETER)
@Retention(value=RUNTIME)
@Documented
public @interface HeaderParam
Binds a HTTP header to a Java method parameter. Where multiple headers of
the same name exist in a request, the first value is used - see
HttpHeaders
for a means of retrieving all values
of particular header. A default value can be specified using the
DefaultValue
annotation.
The type of the annotated parameter must either:
- Be a primitive type
- Have a constructor that accepts a single String argument
- Have a static method named
valueOf
that accepts a single
String argument (see, for example, Integer.valueOf(String)
)
- See Also:
DefaultValue
,
HttpHeaders
Required Element Summary |
java.lang.String |
value
Defines the name of the HTTP header whose value will be used
to initialize the value of the annotated method argument, class field or
bean property. |
value
public abstract java.lang.String value
- Defines the name of the HTTP header whose value will be used
to initialize the value of the annotated method argument, class field or
bean property. Case insensitive.