Spring Boot无法在应用程序中找到jsp文件。我不知道为什么它不能在给定的路径中找到jsp文件。你能让我知道如何解决吗
SpringBootHelloWorldApplication.java
if [MSName] == "fm + / *"
WelcomeController.java
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringBootHelloWorldApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootHelloWorldApplication.class, args);
}
}
application.properties
@Controller
public class WelcomeController {
@RequestMapping("/hello")
public String getHello(Model model){
model.addAttribute("message", "welcome to the jsp page");
return "welcome";
}
}
welcome.jsp
spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp
pom.xml
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html lang="en">
<body>Message: ${message}
</body>
</html>