SpringBoot返回jsp页面配置

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-jasper</artifactId>
    <scope>provided</scope>
</dependency>

SpringBoot文件目录创建 :  src/main/webapp/WEB-INF/jsp
application.yml

spring:
  mvc:
    view:
      prefix: /WEB-INF/page/
      suffix: .jsp
@Controller
@RequestMapping("/file") 
public class FileController {
	
	@RequestMapping("/fileurls")
	public String FileUrls() {
		//ModelAndView mod = new ModelAndView("file");
		System.out.println("OK");
		return "filePath";
	}
}

猜你喜欢

转载自blog.csdn.net/qq_25635139/article/details/88031573