[英]Adding jsp to spring boot project
我正在开始一个新项目,我正在尝试将 spring 引导配置为 web 项目以使用 jsp。 我正在使用 Spring 工具套件 4。
我在设置时添加了 spring web 选项。
我在 application.properties 中添加了以下内容
spring.mvc.view.prefix: /WEB-INF/jsp/
spring.mvc.view.suffix: .jsp
我的 pom 文件中也有以下依赖项
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<!-- Need this to compile JSP -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
当我尝试将 tsp 添加到 main/webapp/WEB-INF/jsp 文件夹时,我没有得到 jsp 选项。
尝试从 eclipse 市场安装插件
Go帮助-> eclipse 市场
然后搜索Eclipse Java EE Developer Tools
安装它并重新启动您的 IDE
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.