Skip to content

Instantly share code, notes, and snippets.

@Robinyo
Created December 2, 2016 04:12
Show Gist options
  • Save Robinyo/4bccafcfb998eb27bb0b71e418220fdc to your computer and use it in GitHub Desktop.
Save Robinyo/4bccafcfb998eb27bb0b71e418220fdc to your computer and use it in GitHub Desktop.
package org.robferguson.resteasy.examples.helloworld.resource;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@Path("/hello")
@Produces(MediaType.TEXT_PLAIN)
public class MessageResource {
@GET
@Path("/{param}")
public Response printMessage(@PathParam("param") String msg) {
String result = "Hello " + msg + "!";
return Response.status(200).entity(result).build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment