Created
May 23, 2014 17:39
-
-
Save SIRHAMY/b54ed86b7f5c56df0ead to your computer and use it in GitHub Desktop.
Example REST @QueryParam
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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