【发布时间】:2016-05-29 08:41:35
【问题描述】:
我实际上使用的是 Spring MVC、Spring Security 和 Thymeleaf。 如何在我的应用程序中添加使用 jsp 的可能性?
我尝试将这些行添加到我的 应用程序.properties
spring.mvc.view.prefix=classpath:/templates/jsp/
spring.mvc.view.suffix=.jsp
我的想法是我希望能够在文件夹中使用 jsp src/main/resources/模板/jsp/ 以及 src/main/resources/templates/thymeleaf/ 中的 thymeleaf html 文件
我的控制器
@Controller
public class HelloJSP {
@RequestMapping("/jsp")
public String helloJSP() {
return "hello";
}
}
我的 hello.jsp 在文件夹 src/main/ressources/templates/jsp/hello.jsp
我需要在 Spring 安全资源处理程序中的某处注册 jsp 资源吗?
【问题讨论】:
-
我特指配置“多视图解析器”,但不知道如何不破坏spring boot的自动配置。
标签: jsp spring-mvc