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

45 questions
11
votes
6 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,538
  • 1
  • 17
  • 32
4
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
  • 13,729
  • 18
  • 91
  • 187
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
  • 267
  • 1
  • 4
  • 13
3
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
  • 13,729
  • 18
  • 91
  • 187
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
  • 362
  • 6
  • 13
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,952
  • 6
  • 32
  • 47
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
  • 13,729
  • 18
  • 91
  • 187
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
  • 13,729
  • 18
  • 91
  • 187
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,671
  • 10
  • 42
  • 103
2
votes
0 answers

How to serve static assets from filesystem rather than default assets JAR bundle (Play Framework)

Play Framework bundles static assets into a JAR bundle which is used at runtime to resolve (via classpath lookup) requested assets. I would like, instead, to specify a filesystem location where these static assets should be served from. I found a…
borice
  • 1,009
  • 1
  • 8
  • 15
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

Splitting routes with prefix not working in Play 2.7 (worked in 2.6)

Our project uses multiple routes files. The conf/routes file contains something like: /some/stuff ... -> /api/admin admin.Routes -> /api/user user.Routes We then have conf/admin.routes and conf/user.routes files, which contain the…
Callum M
  • 1,635
  • 19
  • 27
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,787
  • 4
  • 35
  • 60
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
1 answer

Is it possible to access route parameters in action composition in Play Framework 2.7?

I'm looking for the best way to access route parameters from within a custom action composition. I found some answers from a couple of years ago suggesting it was not possible in Java then but wanted to know if anything had changed since…
Adam
  • 29
  • 6
1
2 3