Specifies the URI of the injected resource target
.
The value must be in the form of absolute URI if not used from inside of
a JAX-RS component class. For example:
public class AuditingFilter implements RequestFilter {
@Uri("users/{name}/orders")
Target userOrders;
// An external resource target
@Uri("http://mail.acme.com/accounts/{name}")
Target userEmailAccount;
...
}
If used from within a JAX-RS component class (e.g. resource, filter, provider …),
the value can take a form of absolute or relative URI or absolute or relative URI.
A relative URI is resolved using the application path
as the base URI. For example:
public class AuditingFilter implements RequestFilter {
@Uri("audit/logs")
Target applicationLogs;
@Uri("http://sales.acme.com/audit/logs")
Target domainLogs;
...
}
In case the annotation is used from a JAX-RS resource class, an absolute
or relative URI template value may be provided. The template parameter (e.g. {id})
values are resolved in the context of the enclosing resource class
path template
as well as the context of the processed request.
For example:
@Path("users/{name}")
public class MyResource {
@Uri("users/{name}/orders")
Target userOrders;
@Uri("http://mail.acme.com/accounts/{name}")
Target userEmailAccount;
...
}
- See Also:
Target
,
Path