3 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory;
5 import org.springframework.http.HttpStatus;
6 import org.springframework.stereotype.Controller;
7 import org.springframework.ui.Model;
8 import org.springframework.web.bind.annotation.ExceptionHandler;
9 import org.springframework.web.bind.annotation.RequestMapping;
10 import org.springframework.web.bind.annotation.RequestParam;
11 import org.springframework.web.bind.annotation.ResponseStatus;
12 import org.thymeleaf.exceptions.TemplateInputException;
15 public class TestController
17 private final static Logger LOG =
18 LoggerFactory.getLogger(TestController.class);
21 @RequestMapping("/controller.html")
22 public String controller(
23 @RequestParam String template,
27 model.addAttribute("template", template);
31 @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
32 @ExceptionHandler(TemplateInputException.class)
33 public void templateInputException(TemplateInputException e)
35 LOG.error("{}: {}", HttpStatus.INTERNAL_SERVER_ERROR, e.getMessage());