试图运行 spring-boot Web 应用程序,该应用程序返回 JSP 页面作为响应
控制器代码为:
public class IndexCtrl {
@RequestMapping(value="home")
public String example() {
return "test.jsp";
}
}
在 POM 中.xml添加了 Tomcat-Jasper 依赖项。
错误 6352 --- [NIO--exec-X] o.s.b.w.servlet.support.ErrorPageFilter : 无法转发到错误 请求 [] 的页面,因为响应已经 承诺。因此,响应可能具有错误的状态代码。 如果您的应用程序在 WebSphere Application Server 上运行,那么您可以 能够通过设置 com.ibm.ws.webcontainer.invokeFlushAfterService to false
将@RequestMapping(value="home"(更改为@RequestMapping("/home"( 它在 Spring 引导版本 2.2.5.Release 中对我有用