Browse Source

individual lines for earch annotation

master
Sebastian Rieger 6 years ago
parent
commit
b07e264d86
  1. 9
      VerteilteSysteme-Examples/src/verteiltesysteme/rest/RESTToLowerCaseService.java
  2. 9
      VerteilteSysteme-Examples/src/verteiltesysteme/rest/RESTToUpperCaseService.java

9
VerteilteSysteme-Examples/src/verteiltesysteme/rest/RESTToLowerCaseService.java

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

9
VerteilteSysteme-Examples/src/verteiltesysteme/rest/RESTToUpperCaseService.java

@ -9,19 +9,22 @@ public class RESTToUpperCaseService
{ {
static final String webContextPath = "/tolowercase"; static final String webContextPath = "/tolowercase";
@GET @Produces( MediaType.TEXT_PLAIN )
@GET
@Produces( MediaType.TEXT_PLAIN )
public String toLowerCasePlain( @QueryParam("input") String input ) public String toLowerCasePlain( @QueryParam("input") String input )
{ {
return "Plain-Text: " + input.toLowerCase(); return "Plain-Text: " + input.toLowerCase();
} }
@GET @Produces( MediaType.TEXT_HTML )
@GET
@Produces( MediaType.TEXT_HTML )
public String toLowerCaseHtml( @QueryParam("input") String input ) public String toLowerCaseHtml( @QueryParam("input") String input )
{ {
return "<html><title>RESTService</title><body><h2>HTML: " + input.toLowerCase() + "</h2></body></html>"; return "<html><title>RESTService</title><body><h2>HTML: " + input.toLowerCase() + "</h2></body></html>";
} }
@GET @Produces( MediaType.APPLICATION_JSON )
@GET
@Produces( MediaType.APPLICATION_JSON )
public String toLowerCaseJson( @QueryParam("input") String input ) public String toLowerCaseJson( @QueryParam("input") String input )
{ {
return "{\n \"type\": \"JSON\",\n \"output\": \"" + input.toLowerCase() + "\"\n}"; return "{\n \"type\": \"JSON\",\n \"output\": \"" + input.toLowerCase() + "\"\n}";

Loading…
Cancel
Save