Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.0-M4 - Cannot customise Views in Java and re-use existing securesocial view templates #593

Open
sdk451 opened this issue May 30, 2016 · 2 comments

Comments

@sdk451
Copy link

sdk451 commented May 30, 2016

v3.0-M4 java templating doesn't appear to work if you want to reuse existing securesocial templates like provider.scala.html or main.scala.html (although most would provide their own main view), as these both require an implicit play.api.i18n.Messages object as an input. This implicit Messages var conflicts with the Java play.i18n.Messages implictMessages variable passed into templates by PlayMagicForJava. It can't be made explicit (as then the method signature in the ViewTemplates subclass conflicts with the superclass, causing a compile error). This is pretty serious issue, because Messages need to be passed to basically every view template, and with securesocial pasing them implicitly they conflict with the play framework Messages in java (also passed implicitly but through a slightly different namespace). With this issue, I can't see an obvious way to get customised views working for v3.0-M4 for Java developers. Customising views apparently works for scala, and I believe this is because play for scala uses play.i18n.Messages not play.api.i18n.Messages. Play Java automatically uses PlayMagicForJava to convert explicit and implicit vars between java and scala objects for view templates, so it's not possible to avoid this namespace / scope collision.

There must be an explicit / implicit var structure for view templates that allows customisation in both scala and java.

see also #464

@sdk451
Copy link
Author

sdk451 commented May 30, 2016

see also this - #587 - it is a related issue

@risenhoover
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants