Newer
Older
JerseyExercise / src / main / java / com / example / jerseyexercise / resources / Gack.java
package com.example.jerseyexercise.resources;

import org.springframework.stereotype.Component;

import javax.ws.rs.*;
import javax.ws.rs.core.*;

@Component
@Path("/helloGakuworld")
public class Gack {
    private String message = "Hello World!!";

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String getMessage() {
        return message;
    }

    @PUT
    @Produces(MediaType.TEXT_PLAIN)
    public String setMessage(@QueryParam("message") String m) {
        message = m;
        return "Success!!";
    }
}