Skip to content

Instantly share code, notes, and snippets.

@learnit-codeit
Last active August 2, 2021 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save learnit-codeit/6c42c28b6fa6c90107e1a0fd5ad16431 to your computer and use it in GitHub Desktop.
Save learnit-codeit/6c42c28b6fa6c90107e1a0fd5ad16431 to your computer and use it in GitHub Desktop.
@RestController
@RequestMapping("/rest")
public class MyRestController {
@RequestMapping(value="/pathparamexample/{value}", method = RequestMethod.GET)
public ResponseEntity<String> getPathParam(@PathVariable String value) {
System.out.println("Path Variable Value: "+value);
return new ResponseEntity<String>(value,HttpStatus.OK);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment