Skip to content

Instantly share code, notes, and snippets.

@SIRHAMY
Created May 23, 2014 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SIRHAMY/b54ed86b7f5c56df0ead to your computer and use it in GitHub Desktop.
Save SIRHAMY/b54ed86b7f5c56df0ead to your computer and use it in GitHub Desktop.
Example REST @QueryParam
@GET
@Path("/getMyInfoXML")
@Produces("application/xml")
public String getMyInfoXML(@QueryParam("name") String name)
{
StringBuilder sb = new StringBuilder();
String firstName = name;
String lastName = "Greene";
String schoolName = "Georgia Tech";
sb.append("<intern>\n");
sb.append("\t<first>" + firstName + "</first>\n");
sb.append("\t<last>" + lastName + "</last>\n");
sb.append("\t<school>" + schoolName + "</school>\n");
sb.append("</intern>");
return sb.toString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment