minil minil - 29 days ago 17
Java Question

Issues in RESTFul Webservice annotation

I am trying to write a RESTFul Webservice using Jersey.

package sample.hello.resources;

@Path("/hello")
public class HelloResource {
@GET
@Produces({MediaType.TEXT_PLAIN})
public String sayHello() {
return "Hello Jersey";
}
}


My Eclipse give error for all the annotations -
@Path, (Path cannot be resolved to a type)


Do I need to include any other libraries or configure the projects in Eclipse?

Answer

It seems that Path annotation exists in jersey-core library. I think you should include that library in your project

Comments