This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* @author gokhan | |
*/ | |
import javax.ws.rs.*; | |
import javax.ws.rs.core.*; | |
@ApplicationPath("app") | |
public class ApplicationConfig extends Application{ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.ws.rs.*; | |
import javax.ws.rs.core.*; | |
/** | |
* | |
* @author gokhan | |
*/ | |
@Path("/") | |
public class HeadResource { | |
@Path("/test") | |
@HEAD | |
public Response handle(@QueryParam("param1") String param1) { | |
System.out.printf("param1: %s%n", param1); | |
NewCookie c=new NewCookie("deneme","Muslera"); | |
Response r = Response.ok("this body will be ignored").cookie(c) | |
.header("someHeader", "Value").build(); | |
return r; | |
} | |
@Path("/test2") | |
@GET | |
public Response handle2() { | |
NewCookie c=new NewCookie("deneme","Muslera"); | |
Response r = Response.ok("some body content").cookie(c) | |
.header("someHeader2", "Value2").build(); | |
return r; | |
} | |
} |
İYİ KODLAMALAR.
Hiç yorum yok:
Yorum Gönder