【问题标题】:Spring 5 + Tomcat standalone - truncated responseSpring 5 + Tomcat 独立 - 截断响应
【发布时间】:2018-09-12 15:36:00
【问题描述】:

我有使用 Spring Boot 2 和 REST API 编写的应用程序。当我通过 bootRun gradle 任务在嵌入式 Tomcat 服务器上运行这个应用程序时,一切都很好。 问题是当这个应用程序部署在独立的 Tomcat 8.5 服务器上时,服务器响应被截断为 8kB。这是为什么呢?

我的 REST 控制器:

@RestController
public class ApiController {
    public ResponseEntity<Mono<ResultData>> get(String param) {
        // generating data
        return ResponseEntity.ok(Mono.just(ResultData.builder()
            .data(data)
        .build()));
    }
}

【问题讨论】:

    标签: spring tomcat spring-boot


    【解决方案1】:

    解决了。我没有扩展 SpringBootServletInitializer (https://docs.spring.io/spring-boot/docs/current/reference/html/howto-traditional-deployment.html) - 当你想将 Spring Boot 应用程序作为可部署的战争运行时,你必须这样做。

    【讨论】:

      猜你喜欢
      • 2017-04-11
      • 1970-01-01
      • 2015-04-27
      • 1970-01-01
      • 2013-03-02
      • 2014-05-15
      • 2012-10-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多