@RequestMapping("/{tutorial}/{page:[1-9][0-9]*}") public String viewTutorialPage( @PathVariable String tutorial, @PathVariable Integer page, Model model) { model.addAttribute("tutorialId", tutorial); model.addAttribute("tutorial", tutorials.findByPage(tutorial, page)); return "guides/tutorial/show"; }
@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"; }