soc*_*ket 2 java web-development-server playframework playframework-2.0
似乎我在路由中定义Long变量时遇到问题.这是routes文件中的行:
GET /topic/:id controllers.Topics.show(id: Long)
Run Code Online (Sandbox Code Playgroud)
这是处理此路线的方法:
public static Result show(long id) {
// handle request here...
}
Run Code Online (Sandbox Code Playgroud)
我得到的是错误324:
错误324(net :: ERR_EMPTY_RESPONSE):服务器关闭连接而不发送任何数据.
我认为问题在于Long数据类型,因为使用Int它就像魅力一样.
什么是调整使其工作?
您必须在操作中使用Long对象而不是long主要类型:
public static Result show(Long id) {
// handle request here...
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
956 次 |
| 最近记录: |