【问题标题】:Play! framework: no data received玩!框架:未收到数据
【发布时间】:2012-10-16 11:39:38
【问题描述】:

这是我定义的路线:
GET /user/:id controllers.Users.show(id: Long)

这是此 GET 请求的处理程序(在 Users 类中):

public static Result show(long id) {
        return ok("hello " + id);
    }

我得到这个错误:

没有收到数据 无法加载网页,因为服务器未发送数据。 以下是一些建议: 稍后重新载入此网页。 错误 324 (net::ERR_EMPTY_RESPONSE):服务器关闭了连接,没有发送任何数据。

这很奇怪,因为它是唯一存在此问题的页面,而且一切似乎都很正常。
那为什么会这样呢?

【问题讨论】:

    标签: java playframework-2.0


    【解决方案1】:

    使用Long 作为id 的类型(而不是long):

    public static Result show(Long id) {
        return ok("hello " + id);
    }
    

    【讨论】:

      猜你喜欢
      • 2014-10-22
      • 2012-07-31
      • 1970-01-01
      • 1970-01-01
      • 2015-09-21
      • 1970-01-01
      • 2012-09-13
      • 1970-01-01
      • 2012-08-03
      相关资源
      最近更新 更多