sou novo no que se diz respeito a web services, no entanto ultimamente peguei para desenvolver o meu, no entanto não consigo nem fazer um hello world devido a um erro que o Tomcat está me retornando, ele simplesmente não encontra a URL, podem me ajudar?
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) {
}
}
O URL da home é http://localhost:8080/Projeto, essa pagina é encontrada facilmente, no entanto quando vou acessar o URL http://localhost:8080/Projeto/Teste que é para retornar um "olá" ele simplesmente retorna um erro 404 de pagina não encontrada.