-
Notifications
You must be signed in to change notification settings - Fork 155
Description
Version: spring-boot-starter-thymeleaf 2.0.9.RELEASE
for bugs:
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Error resolving template [layouts/default], template might not exist or might not be accessible by any of the configured Template Resolvers] with root cause
org.thymeleaf.exceptions.TemplateInputException: Error resolving template [layouts/default], template might not exist or might not be accessible by any of the configured Template Resolvers
sample:
@RequestMapping({"news/{newsId}"})
public String news(Model model,
@RequestHeader(name = "name", required = false) String name,
@PathVariable("newsId") long newsId) {
logger.info("{} read news {}", name, newsId);
try {
NewsDto newsDto = newsService.info2(newsId, name);
model.addAttribute("newsId", newsId);
model.addAttribute("news", newsDto.getInfo());
model.addAttribute("content", newsDto.getContent());
return "news";
} catch (Exception e) {
logger.error("error ", e);
return "redirect:/404";
}
}