HelloWorld.java 515 Bytes
Newer Older
Gabriele Civitarese's avatar
Gabriele Civitarese committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
package services;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

@Path("/helloworld")
public class HelloWorld {

    @GET
    @Produces("text/plain")
    public String helloWorld(){

        return "Hello world!";

    }

    @GET
    @Produces("application/json")
    public String helloWorld2(){
        return "{\"message\": \"helloWorld\"}";
    }

    @Path("/inner")
    @GET
    @Produces("text/plain")
    public String innerHello(){
        return "Inner Hello!";
    }

}