diff --git a/src/main/java/com/example/jerseyexercise/resources/TokiwaRest.java b/src/main/java/com/example/jerseyexercise/resources/TokiwaRest.java new file mode 100644 index 0000000..66e6e59 --- /dev/null +++ b/src/main/java/com/example/jerseyexercise/resources/TokiwaRest.java @@ -0,0 +1,25 @@ +package com.example.jerseyexercise.resources; + +import org.springframework.stereotype.Component; + +import javax.ws.rs.*; +import javax.ws.rs.core.MediaType; + +@Path("/tokiwa") +@Component +public class TokiwaRest { + private String message = "Hello World!!"; + + @GET + @Produces(MediaType.TEXT_PLAIN) + public String getMessage() { + return message; + } + + @PUT + @Produces(MediaType.TEXT_PLAIN) + public String setMessage(@FormParam("message") String m) { + message = m; + return "Success!!"; + } +}