Created
October 9, 2017 19:15
-
-
Save jakubhalun/0afc2b5881621ef62577a7a4db7356a8 to your computer and use it in GitHub Desktop.
RestController for Byte Buddy instrumentation demo
This file contains 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
@RestController | |
public class HelloController { | |
private static final String template = "Hello, %s!"; | |
@RequestMapping("/hello") | |
public String greeting( | |
@RequestParam(value = "name", defaultValue = "World") String name) { | |
return String.format(template, name); | |
} | |
@RequestMapping("/browser") | |
public String showUserAgent(HttpServletRequest request) { | |
return request.getHeader("user-agent"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment