使用securesocial在Play Framework 2.0.4中进行表单转换

时间:2013-05-08 22:07:34

标签: java scala playframework securesocial

有没有办法在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

希望有人能帮助我。

问候!

1 个答案:

答案 0 :(得分:0)

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