Play Framework: How to serialize/deserialize an enumeration to/from JSON
implicit val genderReads = Reads.enumNameReads(Gender) is working fine for me. Play Scala 2.4.2
implicit val genderReads = Reads.enumNameReads(Gender) is working fine for me. Play Scala 2.4.2
Try invalidating Intellij IDEA cache via File -> Invalidate Caches / Restart It takes like 5 minutes but did the trick for me.
When I was trying something similar I came to the conclusion that it’s better to break it on 2 parts: Use Play as a backend you interact with via Ajax calls Store the Angular templates in Play public folder (something like /public/angular/) and use the default AngularJs way to map the templates I know it … Read more
Play! is a breath of fresh air into Java and bypasses all the Enterprise cruft that has evolved over the years. Even the namespace is just play not com.playframework. It is supposed to be an answer to Rails, Django etc and is MVC based. It is needed for Java to stay relevant in all but … Read more
IIRC, change <link rel=”stylesheet” media=”screen” href=”https://stackoverflow.com/questions/9792875/@routes.Assets.at(“stylesheets/main.css”)”> To <link rel=”stylesheet” media=”screen” href=”https://stackoverflow.com/questions/9792875/@routes.Assets.at(“stylesheets/”, “main.css”)”> I am talking about your third attempt Also, watch out for extra / EDIT GET /assets/main.css controllers.Assets.at(path=”/public”, file=”/stylesheets/main.css”) Assuming your resource is at /public/stylesheets/main.css
Most convenient way to run/debug applications in intellij IDEA is the following. Menu command: Run -> Edit Configuration! Add new configuration -> Application Then fill up the fields: Main class: play.server.Server VM Parameters: -Dapplication.path=. You should have something similar: If you did it correctly, then you can run and stop your app right from IDE … Read more
I think this is a grey area. One could argue that the user access is part of the mapping between the HTTP world and the Object-Oriented world. This is what the controller is intended for (hence the heavy use of statics), to transform the incoming request, ready to process the business rules on the domain … Read more
I had a similar problem when testing my controller. I solved it by “File” > “Open Project” and choose the base folder of the Play framework project (delete all idea settings file from the folder before so that it will reimport using the SBT settings). The last version of the SBT support for IDEA did … Read more
Play does not appear to pick up the jvm.memory settings for dependencies or even test command. One way to force it to use specific JVM settings would be to use _JAVA_OPTIONS. For example: export _JAVA_OPTIONS=”-Xms800m -Xmx1500m -XX:PermSize=64m -XX:MaxPermSize=256m” play test or play deps and you should see ~ _ _ ~ _ __ | | … Read more
This is a very tricky business. SBT in Play is used for fetching dependencies, compiling source and templates, and for the SBT incremental compilation + auto-reloading feature. I have written a build.gradle script to resolve all Play 2.0 dependencies and set-up Eclipse or IntelliJ IDEA classpaths, and made it public here. I will try to … Read more