gpt4 book ai didi

java - 玩!框架路线。长数据类型

转载 作者:行者123 更新时间:2023-12-02 10:47:32 25 4
gpt4 key购买 nike

我似乎在路线中定义长变量时遇到问题。这是routes 文件中的行:

GET   /topic/:id                    controllers.Topics.show(id: Long)

这是处理该路由的方法:

public static Result show(long id) {
// handle request here...
}

我得到的是错误 324:

Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

我认为问题出在 Long 数据类型上,因为使用 Int 它就像一个魅力。
使它发挥作用的调整是什么?

最佳答案

您必须在操作中使用 Long 对象而不是 long 主要类型:

public static Result show(Long id) {
// handle request here...
}

关于java - 玩!框架路线。长数据类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11825480/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com