/[projects]/miscJava/Test4Simple/src/main/java/dk/thoerup/webservice/RestSimpleJerseyTest.java
ViewVC logotype

Annotation of /miscJava/Test4Simple/src/main/java/dk/thoerup/webservice/RestSimpleJerseyTest.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2516 - (hide annotations) (download)
Mon Apr 27 15:41:43 2015 UTC (9 years, 1 month ago) by torben
File size: 671 byte(s)
forked test3 to test4 with out the advanced ejb stuff etc
1 torben 2516 package dk.thoerup.webservice;
2    
3     import javax.ws.rs.GET;
4     import javax.ws.rs.Path;
5     import javax.ws.rs.Produces;
6     import javax.ws.rs.core.MediaType;
7    
8     @Path("/Rest")
9     public class RestSimpleJerseyTest {
10    
11     public static class TestResponse {
12     public int id;
13     public String name;
14    
15     public TestResponse(int i, String n) {
16     this.id = i;
17     this.name = n;
18     }
19    
20     }
21    
22     @Path("/Simple")
23     @GET
24     @Produces(MediaType.TEXT_PLAIN)
25     public String getIt() {
26     return "Got it!";
27     }
28    
29     @Path("/Object")
30     @GET
31     @Produces({"application/xml", "application/json"})
32     public TestResponse getObj() {
33     return new TestResponse(1, "Hej");
34     }
35    
36    
37    
38    
39    
40     }

  ViewVC Help
Powered by ViewVC 1.1.20