diff --git a/src/main/java/org/ntlab/hellorest/resources/ShinjiRest.java b/src/main/java/org/ntlab/hellorest/resources/ShinjiRest.java new file mode 100644 index 0000000..4447fbd --- /dev/null +++ b/src/main/java/org/ntlab/hellorest/resources/ShinjiRest.java @@ -0,0 +1,25 @@ +package org.ntlab.hellorest.resources; + +import org.springframework.stereotype.Component; + +import javax.ws.rs.FormParam; +import javax.ws.rs.GET; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; + +@Component +@Path("/shinji") +public class ShinjiRest { + private String name = ""; + + @GET + public String getName() { + return "I'm " + name + "."; + } + + @PUT + public String setName(@FormParam("name") String name) { + this.name = name; + return "success"; + } +}