解决Error resolving template "/sc/getView", template might not exist or might问题

在做项目上使用thymeleaf 模板遇到的坑,项目在Eclipse上面运行正常,打成jar包再运行所报的错 Error resolving template "/XX/XX", template might not exist or might

原因1:看看Controller 里面是否使用的注解是否@RestController

原因2:如果使用@Controller 需要返回JSON 得加上Response

原因3:返回路径问题下面是我配置的

解决Error resolving template "/sc/getView", template might not exist or might问题

解决Error resolving template "/sc/getView", template might not exist or might问题

之前写的是 return "/sc/addScView";

加上  /  后  eclipse 运行没问题,打成Jar包后 模板就会解析不出来