0

有没有办法在 Play Framework中将 play.api.data.Form 转换play.api.data.Form ?

我正在使用安全社交来玩 2.0.4,并且在编译自定义模板时遇到了这些错误。

[error] /home/mario/tegik-play/app/controllers/SecureTemplate.scala:19: type mismatch;
[error]  found   : play.api.data.Form[(String, String)]
[error]  required: play.data.Form[(java.lang.String, java.lang.String)]
[error]     views.html.custom.login(form, msg)
[error]                             ^
[error] /home/mario/tegik-play/app/controllers/SecureTemplate.scala:24: type mismatch;
[error]  found   : play.api.data.Form[securesocial.controllers.Registration.RegistrationInfo]
[error]  required: play.data.Form[securesocial.controllers.Registration.RegistrationInfo]
[error]     views.html.custom.Registration.signUp(form, token)
[error]                                           ^
[error] /home/mario/tegik-play/app/controllers/SecureTemplate.scala:28: type mismatch;
[error]  found   : play.api.data.Form[String]
[error]  required: play.data.Form[java.lang.String]
[error]     views.html.custom.Registration.startSignUp(form)
[error]                                                ^
[error] /home/mario/tegik-play/app/controllers/SecureTemplate.scala:32: type mismatch;
[error]  found   : play.api.data.Form[String]
[error]  required: play.data.Form[java.lang.String]
[error]     views.html.custom.Registration.startResetPassword(form)
[error]                                                       ^
[error] /home/mario/tegik-play/app/controllers/SecureTemplate.scala:36: type mismatch;
[error]  found   : play.api.data.Form[(String, String)]
[error]  required: play.data.Form[(java.lang.String, java.lang.String)]
[error]     views.html.custom.Registration.resetPasswordPage(form, token)
[error]                                                      ^
[error] /home/mario/tegik-play/app/controllers/SecureTemplate.scala:40: type mismatch;
[error]  found   : play.api.data.Form[securesocial.controllers.PasswordChange.ChangeInfo]
[error]  required: play.data.Form[securesocial.controllers.PasswordChange.ChangeInfo]
[error]     views.html.custom.passwordChange(form)
[error]                                      ^
[error] 6 errors found

希望任何人都可以帮助我。

问候!

4

1 回答 1

0

play.api.data.Form是 Scala API,play.data.Form而是 Java API。
确保您在视图中指定了正确的包(我猜是第一个包)。

于 2013-05-08T22:19:10.817 回答