I am learning RESTful Web Services and all the tutorials use javax.ws.rs.*
package. But with JDK 6 and JDK 7, my Eclipse doesn't seem to recognize javax.ws
package. What am I missing here?
Package javax.ws.rsIdentifies the application path that serves as the base URI for all resource URIs provided by Path . Defines the media types that the methods of a resource class or MessageBodyReader can accept.
Java™ API for RESTful Web Services (JAX-RS) is a programming model that provides a mechanism for developing services that follow Representational State Transfer (REST) principles. Using JAX-RS, development of RESTful services is simplified.
JAX-WS represents SOAP. JAX-RS represents REST.
Defines the components of a JAX-RS application and supplies additional metadata. 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 . java.
javax.ws.rs is not a JDK package; it is a server-side API that forms part of the Java EE specification. You would need to include a Java EE runtime on your classpath or source an implementation from a 3rd party if you're going the self-assembly route (e.g. using Tomcat.)
You're may be missing Jersey installation, or something in your environment configuration. Try also installing Eclipse WPT. You can follow this tutorial, it covers prerequisites and basic installation procedures as well.
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