Questions tagged [play-framework-2.7]

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.7

Migration Guide

47 questions
10
votes
5 answers

MongoError No primary node is available

We have upgraded to Play 2.7.0 recently and use play2-reactivemongo version 0.16.2 with reactivemongo 0.16.3. We use reactivemongo-shaded-native but also tried without. We are connecting to a replica set with 3 nodes, MongoDB 3.6.10 on MongoDB…
cbley
  • 4,133
  • 1
  • 14
  • 29
4
votes
1 answer

Unresolved dependency: sbt-plugin;2.7.0 when trying to compile a play template project

Created a new play template project following the guidance on Play's website "sbt new playframework/play-scala-seed.g8" Trying to compile/run the project I get the following: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: …
Ramin
  • 127
  • 8
3
votes
1 answer

How to filter JSON array results based on condition?

I'm using Scala Play 2.7.2 and have read ScalaJsonTransformers and ScalaJson. After calling a JSON API I get back (simplified MCVE) results like this: { "type": "searchset", "total": 5, "entry": [ { "start": "2019-06-07T09:00:00", …
SkyWalker
  • 11,704
  • 14
  • 65
  • 144
3
votes
1 answer

Java Play Framework - NoClassDefFoundError: play/Configuration

I've just startet to work with the Java Play Framework and made some steps forward but now i intended to add the JavaEbean OEM and i went through the documentation but still get the error NoClassDefFoundError: play/Configuration application.conf …
jo-chris
  • 112
  • 1
  • 6
2
votes
2 answers

Play Router: How to add a language-sensitive URL redirect rule?

I have an internationalized Scala Play 2.7.x WebApp and have the usual routes e.g. GET / controllers.ApplicationController.index GET /page/somePage/ controllers.SomeController.somePage GET /contact …
SkyWalker
  • 11,704
  • 14
  • 65
  • 144
2
votes
0 answers

Swagger-play2 - hiding internal parameters

I have configured swagger-play2 library version 1.7.1 (for play framework version 2.7) and have it up and running successfully. Our controller methods have an additional input: Http.Request request which is passed across the application for some…
popcoder
  • 2,552
  • 6
  • 30
  • 45
2
votes
1 answer

How to enable logging DEBUG-level only for the Application Controllers'?

I'm on Scala 2.12.x Play 2.7.x and as part of my Application Controllers I'm using the logger like this (or equivalently by doing with play.api.Logging): val logger = play.api.Logger(this.getClass) and the configuration conf/logback.xml is shown…
SkyWalker
  • 11,704
  • 14
  • 65
  • 144
2
votes
1 answer

Scala Play: Routes optional parameter with regex?

For one of my routes I have an optional parameter i.e. birthDate: Option[String] and can do this: GET /rest/api/findSomeone/:firstName/:lastName controllers.PeopleController.findSomeone(firstName: String, lastName: String, birthDate:…
SkyWalker
  • 11,704
  • 14
  • 65
  • 144
2
votes
2 answers

swagger:CreationException: in play framework 2.7

I am using play-framework 2.7 and following this tutorial https://github.com/swagger-api/swagger-play/tree/master/play-2.6/swagger-play2 i followed all the steps added play.modules.enabled += "play.modules.swagger.SwaggerModule" in…
swaheed
  • 3,055
  • 7
  • 28
  • 79
1
vote
0 answers

How do I use multiple Play routes files with path parameters in the main Routes file?

Scala version 2.12, Play version 2.7 I have a very large Routes file that I'd like to split up into multiple files as it contains distinct user journeys which can be 20+ pages long. It currently looks something like this: GET /x/:param/a/... …
James Whiteley
  • 3,173
  • 1
  • 13
  • 35
1
vote
1 answer

Play Framework @ValidateWithPayload

I'm trying to pass a payload to a validate(ValidationPayload) in the Play Framework using Java. I can not access the values stored in payload.getAttrs() which returns a TypedMap. I tried to access the Cookies by calling in the validate method…
snjall
  • 23
  • 5
1
vote
1 answer

Play framework check whether a key exists

I'm using Play Framework for ease in JSON parsing in Scala. My code looks like: def getAuthToken(userid: String, password: String): String = { val body: JsValue = Json.obj("userid" -> userid , "password" -> password) val res =…
Sparker0i
  • 1,464
  • 3
  • 24
  • 45
1
vote
1 answer

How to mock BodyParser.Default parameter of ActionBuilder?

I want to write the test for the following controller. class DashboardController @Inject()(cc: ControllerComponents, dashboardDataService: DashboardService, …
1
vote
0 answers

Scala Play: What's the approach to externalize big JSON templates?

I'm working on a Scala 2.12.x Play 2.7.x project that calls a WS API and therefore, I have the need for storing big JSON templates with placeholders for reuse, something alla e.g. { "birthDate": "$birthDate", "givenName": "$givenName", …
SkyWalker
  • 11,704
  • 14
  • 65
  • 144
1
vote
1 answer

Scala Play: How to render Form mappings with Repeated and Nested values?

I'm working on a Scala Play 2.7.x (you may checkout the project here play-silhouette-seed googleauth branch) and I have a form defined as: object TotpSetupForm { val form = Form( mapping( "sharedKey" -> nonEmptyText, "scratchCodes"…
SkyWalker
  • 11,704
  • 14
  • 65
  • 144
1
2 3 4