I am learning to develop with rest when I put the URL I always had HTTP status 404 - Not found Type Status report message The requested resource [/ jaxres-4sae5 / api / greetings / hello] is not available description The requested resource is not available. and I did not know the problem.
@Path("greetings")
public class HelloResource {
@Path("hello")
@GET
@Produces(MediaType.TEXT_PLAIN)
public String sayHello() {
return "Hello from JAX-RS";
}
@GET
@Path("{firstName}/{LastName}")
@Produces(MediaType.TEXT_PLAIN)
public String sayhello2( @PathParam(value="lastName")String nom, @PathParam(value="firstName")String prenom) {
return "hello from JAXRS" + prenom +" "+ nom;
}
@GET
@Produces(MediaType.TEXT_PLAIN)
public String sayHelloTo2(@QueryParam(value="FirstName") String prenom ,
@QueryParam(value="LastName") String nom ) {
return "hello from JAXRS" + prenom + " " + nom;
}