@RequestMapping("/{tutorial}/images/{image:[a-zA-Z0-9._-]+}") public ResponseEntity<byte[]> loadImage( @PathVariable String tutorial, @PathVariable String image) { return new ResponseEntity<>(tutorials.find(tutorial).getImage(image), HttpStatus.OK); }
@RequestMapping("/{tutorial}") public String viewTutorial(@PathVariable String tutorial, Model model) { model.addAttribute("tutorialId", tutorial); model.addAttribute("tutorial", tutorials.find(tutorial)); return "guides/tutorial/show"; }