Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
RestController for Byte Buddy instrumentation demo
@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
You can’t perform that action at this time.