diff --git a/src/main/java/com/example/jerseyexercise/resources/ButterRest.java b/src/main/java/com/example/jerseyexercise/resources/ButterRest.java new file mode 100644 index 0000000..aba266b --- /dev/null +++ b/src/main/java/com/example/jerseyexercise/resources/ButterRest.java @@ -0,0 +1,27 @@ +package com.example.jerseyexercise.resources; + +import org.springframework.stereotype.Component; + +import javax.ws.rs.*; +import javax.ws.rs.core.*; + +@Component +@Path("/butter") +public class ButterRest { + private String message = "Hello"; + + @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!!"; + } + + +}