有没有办法在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
希望有人能帮助我。
问候!
答案 0 :(得分:0)
play.api.data.Form
是Scala API,而play.data.Form
是Java
确保你在视图中指定了正确的包(我猜的第一个)。