Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. package br.com.gomes.LojaDeVendas.util;
  2.  
  3. import javax.ws.rs.ApplicationPath;
  4. // chamando o pacote do service
  5.  
  6. import org.glassfish.jersey.server.ResourceConfig;
  7.  
  8. @ApplicationPath("rest")
  9.  
  10. public class LojaDeVendasResourceConfig extends ResourceConfig{
  11.  
  12. public LojaDeVendasResourceConfig(){
  13.  
  14. packages("br.com.gomes.LojaDeVendas.service");
  15. }
  16. }
  17.  
  18. //chamado o conteiner para retorna a resposta abaixo no browser
  19. package br.com.gomes.LojaDeVendas.service;
  20.  
  21. import javax.ws.rs.GET;
  22. import javax.ws.rs.Path;
  23.  
  24. // http://localhost:8080/LojaDeVendas/rest/vendas
  25. @Path("vendas")
  26. public class LojaDeVendasService {
  27.  
  28. @GET
  29. public String exibir() {
  30. return "Curso de Java";
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement