예제 #1
0
 @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";
 }
예제 #2
0
 @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);
 }
예제 #3
0
 @RequestMapping("/{tutorial}")
 public String viewTutorial(@PathVariable String tutorial, Model model) {
   model.addAttribute("tutorialId", tutorial);
   model.addAttribute("tutorial", tutorials.find(tutorial));
   return "guides/tutorial/show";
 }