javax.ws.rs
Annotation Type Path


@Target(value={TYPE,METHOD})
@Retention(value=RUNTIME)
public @interface Path

Identifies the URI path that a resource class or class method will serve requests for. Root resource classes require an @Path annotation. Classes may also be annotated with ConsumeMime and ProduceMime to filter the requests they will receive.

See Also:
ConsumeMime, ProduceMime

Required Element Summary
 java.lang.String value
          Defines a URI template for the resource.
 
Optional Element Summary
 boolean encode
          Controls whether the literal part of the supplied value (those characters that are not part of a template variable) are URL encoded.
 boolean limited
          Controls whether a trailing template variable is limited to a single path segment (true) or not (false).
 

Element Detail

value

public abstract java.lang.String value
Defines a URI template for the resource. Requests to URIs that match the template will be served by the annotated class or class method. Embedded template variables are allowed and are of the form {name} where name is the template variable name. Paths are relative to the base URI of the container and must not include matrix parameters.

E.g.: @Path("widgets/{id}")

encode

public abstract boolean encode
Controls whether the literal part of the supplied value (those characters that are not part of a template variable) are URL encoded. If true, any characters in the URI template that are not valid URI character will be automatically encoded. If false then all characters must be valid URI characters.

Default:
true

limited

public abstract boolean limited
Controls whether a trailing template variable is limited to a single path segment (true) or not (false). E.g. @Path("widgets/{id}") would match widgets/foo but not widgets/foo/bar whereas @Path(value="widgets/{id}", limit=false) would match both.

Default:
true


Copyright © 2008. All Rights Reserved.