I'm new to web services, however lately I've gotten to develop my own, however I can not even do a hello world due to an error that Tomcat is returning me, it just does not find the URL, can you help me?
package Login;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.Consumes;
import javax.ws.rs.Produces;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PUT;
import javax.ws.rs.core.MediaType;
/**
* REST Web Service
*
* @author Matheus
*/
@Path("/Teste")
public class Teste {
@Context
private UriInfo context;
/**
* Creates a new instance of Teste
*/
public Teste() {
}
/**
* Retrieves representation of an instance of Login.Teste
* @return an instance of java.lang.String
*/
@GET
@Produces("text/plain")
public String getText() {
//TODO return proper representation object
return "ola";
}
/**
* PUT method for updating or creating an instance of Teste
* @param content representation for the resource
*/
@PUT
@Consumes(MediaType.TEXT_PLAIN)
public void putText(String content) {
}
}
The home URL is link , this page is easily found, however when I go to the URL link which is to return a" hello "it simply returns a page 404 not found error.