我使用的反向路线适用于 Play Framework 2.3.10,但 IntelliJ IDEA 16(迄今为止的最新版本)指出错误:
@helper.form(routes.MyController.doSomething(userEmail)) {
...
}
IDEA 需要 Nothing
参数,因此此更改“删除”了 IDEA 错误(但显然它不起作用,因为参数是 String
) .
@helper.form(routes.MyController.doSomething(new Nothing)) {
...
}
顺便说一句,不带参数的方法不存在这个问题:
@helper.form(routes.MyController.doWhatever()) {
...
}
Controller 就像:
public class MyController extends Controller {
public Result doSomething(String email) {
...
}
public Result doWhatever() {
...
}
}
你知道如何消除IntelliJ IDEA中的错误吗?
谢谢!
最佳答案
听起来您遇到了与我非常相似的问题,正如您在此处看到的:
Intellij Play Intellisense issues
对我来说,代码可以编译,但 intellij 的“intellisense”认为参数不正确,即使它们是正确的。
关于java - 在 IntelliJ IDEA 中,Play 框架反向路由期望 Nothing 作为参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36415401/