Questions tagged [playframework-2.2]

Play is based on a lightweight, stateless, web-friendly architecture and features predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications.

Play is based on a lightweight, stateless, web-friendly architecture and features predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications.

What's new in Play 2.2

1112 questions
82
votes
1 answer

Convert JsonNode object to Map

I have a C# program that sends me a json object. I'm making a Java Play website to capture the POST data. I get the correct data as a JsonNode object but need to convert it into a Map. I'm using com.fasterxml.jackson.databind.JsonNode Here is where…
visc
  • 4,794
  • 6
  • 32
  • 58
38
votes
4 answers

When to use Actors vs Futures?

I am currently working on a Play! project that has the following architecture: Controllers -> Services (actors) -> Models (Regular case classes) For each request that comes in, we will issue a call to the service layers like so: Service ?…
James Cowhen
  • 2,837
  • 3
  • 24
  • 32
38
votes
1 answer

How to disable ScalaDoc generation in dist task in Play 2.2.x (using project/build.scala)?

Adding the following settings to the build.sbt file of a Play 2.2.x app does not disable Scaladoc generation. How can it be disabled? play.Project(appName, appVersion, appDependencies) .settings(scalaVersion := "2.10.3") …
Max L.
  • 9,774
  • 15
  • 56
  • 86
37
votes
7 answers

Defaults for missing properties in play 2 JSON formats

I have an equivalent of the following model in play scala : case class Foo(id:Int,value:String) object Foo{ import play.api.libs.json.Json implicit val fooFormats = Json.format[Foo] } For the following Foo instance Foo(1, "foo") I would get…
Jean
  • 21,329
  • 5
  • 46
  • 64
35
votes
2 answers

IntelliJ IDEA Report Highlighting error when using routes in Controller

I have a Scala Play project. I'm using Play 2.2.1. I downloaded Scala, Play 2 supported and SBT plugins. Everything is OK, but When I call route on Action in the Controller appear following error(Look screenshots): I'm using IntelliJ IDEA 12.1.6…
SBotirov
  • 13,872
  • 7
  • 59
  • 81
20
votes
2 answers

Convert any Scala object to JSON

I am using latest version of Play Framework and it's JSON lib like this Json.toJson(obj). But toJson is not capable of converting any Scala object to JSON, because the structure of data is unknown. Someone suggested using case convert, but here my…
Vilis
  • 1,062
  • 2
  • 12
  • 21
19
votes
3 answers

Upgrading project to version 2.2.0 of the Play Framework

When upgrading a play project to 2.2.0 the following error comes up: sbt.ResolveException: unresolved dependency: play#sbt-plugin;2.2.0: not found
Donovan
  • 213
  • 2
  • 6
15
votes
2 answers

Play Framework 2.2 : Get URL of the requesting page

PLAY FRAMEWORK JAVA: I am trying to get the name of the URL that requested the controller function. For example , I have a routes as GET /mypage controllers.Mypage.myfunction() and I have another page that requests the same…
Incpetor
  • 1,293
  • 6
  • 25
  • 46
15
votes
4 answers

Optional params with Play 2 and Swagger

I'm trying to use Swagger to document a Play 2 REST API but swagger-play2 doesn't seem to understand optional parameters defined with Scala's Option type - the normal way to make a param optional in Play 2: GET /documents…
Tom Wadley
  • 121,983
  • 1
  • 26
  • 29
13
votes
4 answers

Enable CORS in Java Play Framework 2.2.x

I am having trouble of enabling cross domain in Java Play 2.2.x In Java Play 2.1.3 this code works by putting it in Global.java public class Global extends GlobalSettings { private class ActionWrapper extends Action.Simple { public…
hrusli
  • 283
  • 3
  • 14
13
votes
2 answers

Unable to test controller using Action.async

I'm trying to test controller, which is using new Action.async. Following documentation I have excluded part under controller I want to test to separate trait with type reference: trait UserController { this: Controller => def index() = Action {…
mcveat
  • 1,416
  • 15
  • 34
13
votes
1 answer

Using Play!Framework 2.2 subprojects

I'm trying to split my Play!Framework 2.2 project in subprojects and I have some hard time figuring it out. Here's my folder structure : MyProject/ | - app/ | --- controllers/ # containing some main controllers | --- views/ # resulting views |…
Cyril N.
  • 38,875
  • 36
  • 142
  • 243
12
votes
5 answers

Why does sbt fail with NoClassDefFoundError: play/Play$ in Play 2.2.x projects after sbt compile in Play 2.3 project?

Once I run 'sbt compile' on a 2.3 play project, I can't use 'sbt compile' to compile any Play 2.2.x projects anymore. This is the error when I run sbt command. [info] Loading project definition from /Users/macbookpro/playproject/project [error]…
angelokh
  • 9,426
  • 9
  • 69
  • 139
12
votes
2 answers

How to run Play 2.2.x with Akka 2.3.x?

Is there any way to combine akka 2.3 and play 2.2? For now I'm getting AbstractMethodError while running such application. I need to have them both in one app because Akka 2.3 comes with very useful akka persistence module which is very reliable(in…
12
votes
4 answers

Play framework 2.2.1: Create Http.Context for tests

I've been trying to create an Http.Context for tests using its constructor unsuccessfully. Does anybody see what I'm doing wrong? I've looked at the following but it only applies to Play 2.0: Play framework 2.0: Store values in Http.Context It looks…
Rico
  • 58,485
  • 12
  • 111
  • 141
1
2 3
74 75