I'm trying to get into JAX-RS. My project jdk is set to 1.7.03. Does there have to be definitions of annotations for JAX-RS(javax.ws.rs)? If not, where I can find them?
Package javax.ws.rsIdentifies the application path that serves as the base URI for all resource URIs provided by Path . Consumes. Defines the media types that the methods of a resource class or MessageBodyReader can accept.
A JAX-RS application or implementation supplies a concrete subclass of this abstract class. The implementation-created instance of an Application subclass may be injected into resource classes and providers using Context . Constructor Summary.
The @Path annotation identifies the URI path template to which the resource responds and is specified at the class or method level of a resource.
The @Context annotation is an all-purpose annotation that injects instances of the following objects: HttpHeaders -> HTTP header parameters and values. UriInfo -> Captures path variables and query parameters. SecurityContext -> Provides access to security related information for a request.
These classes (JSR 311: JAX-RS: The JavaTM API for RESTful Web Services) are not part of the JDK. You need to include appropriate JAR file to your CLASSPATH. You can find the API e.g. in maven repository.
Also check out apache-cxf, jersey (reference implementation), resteasy from JBoss, restlet and few other JAX-RS implementations.
Try: http://download.oracle.com/otndocs/jcp/jaxrs-2_0_rev_A-mrel-spec/index.html
Download: javax.ws.rs-api-2.0.rev.A.jar
Then add to your Project Properties(YourProjectName)->Libraries->Add JAR/Folder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With