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

1111 questions
59
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
  • 3,627
  • 3
  • 25
  • 49
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
  • 20,591
  • 5
  • 43
  • 61
36
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.
  • 8,994
  • 12
  • 49
  • 80
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…
mr.boyfox
  • 12,894
  • 5
  • 51
  • 75
34
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,697
  • 3
  • 21
  • 32
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
18
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
  • 930
  • 1
  • 10
  • 19
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
  • 122,421
  • 1
  • 22
  • 29
14
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,235
  • 6
  • 24
  • 46
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
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.
  • 35,568
  • 34
  • 119
  • 213
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,394
  • 6
  • 61
  • 119
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
  • 48,741
  • 12
  • 84
  • 107
12
votes
3 answers

Detect Play 2.2.x mode prior to start of Application using Java

I want to point my play application to a particular application config file based on the environment it is running in. There are three and they correspond to the standard Play states: application.dev.conf application.test.conf…
Jerry Mindek
  • 493
  • 5
  • 13
1
2 3
74 75