|
|
@ -9,19 +9,22 @@ public class RESTToLowerCaseService |
|
|
|
{ |
|
|
|
static final String webContextPath = "/touppercase"; |
|
|
|
|
|
|
|
@GET @Produces( MediaType.TEXT_PLAIN ) |
|
|
|
@GET |
|
|
|
@Produces( MediaType.TEXT_PLAIN ) |
|
|
|
public String toUpperCasePlain( @QueryParam("input") String input ) |
|
|
|
{ |
|
|
|
return "Plain-Text: " + input.toUpperCase(); |
|
|
|
} |
|
|
|
|
|
|
|
@GET @Produces( MediaType.TEXT_HTML ) |
|
|
|
@GET |
|
|
|
@Produces( MediaType.TEXT_HTML ) |
|
|
|
public String toUpperCaseHtml( @QueryParam("input") String input ) |
|
|
|
{ |
|
|
|
return "<html><title>RESTService</title><body><h2>HTML: " + input.toUpperCase() + "</h2></body></html>"; |
|
|
|
} |
|
|
|
|
|
|
|
@GET @Produces( MediaType.APPLICATION_JSON ) |
|
|
|
@GET |
|
|
|
@Produces( MediaType.APPLICATION_JSON ) |
|
|
|
public String toUpperCaseJson( @QueryParam("input") String input ) |
|
|
|
{ |
|
|
|
return "{\n \"type\": \"JSON\",\n \"output\": \"" + input.toUpperCase() + "\"\n}"; |
|
|
|