Questions tagged [playframework]
Play Framework is a modern open-source web framework for Java and Scala.
17,186
questions
0
votes
2
answers
19
views
Java Play overwrites port in application.conf
I want to specify port on which Java Play exposes its endpoints in the application.conf file – complete snippet of the application.conf, format taken from Java Play documentation
play.server.http.port ...
0
votes
0
answers
16
views
How can i make a math operation as a POST request and gets its value as a response(Scala/Play framework)
I am new to scala and play framework.Request and response that i wanted should look like the in image Image link
-2
votes
0
answers
17
views
Sample working application with latest version
I have tried many sample application but it doesn't work
Can someone help me with a sample play framework application which works fine?
Thanks
0
votes
0
answers
9
views
CRUD sample app works with play framework
I would like to explore CRUD basic app with play framework.
Can someone helps with a good working app source to build and run locally ?
Thanks
0
votes
2
answers
35
views
How to Json encode a case class that inherits from a trait in Play?
I have a trait which is a base class for some case classes:
trait BaseHeaders {
val timestamp: LocalDateTime
val host: String
val os: String
val method: String
val userAgent: String
}
...
0
votes
0
answers
6
views
play evolutions API: play.api.db.evolutions.InconsistentDatabase
I have following script for play evolution API:
# --- !Ups
ALTER TABLE "TABLE_1" MODIFY (
"ADDRESS"
VARCHAR2(600)
);
ALTER TABLE "TABLE_1_HIST" ...
2
votes
1
answer
100
views
+250
Play framework: JsonNode streaming/chunking
I have a large map that I want to return to the frontend. Originally I was converting the map to a jackson json node and returning the map back to the user with the return ok() method that play ...
0
votes
1
answer
22
views
Scala Play Framework: cannot generate object from json with null values
I'm new to Scala and the Play Framework. I have written the following controller:
@Singleton
class MyController @Inject()(val controllerComponents: ControllerComponents) extends BaseController {
...
0
votes
0
answers
20
views
play.api.libs.json is not able to parse uuid string
In scala play application, I am trying to parse uuid as a json response but getting error:
play.api.libs.json.Json.parse(s"""
{
"id" : "ac435876-fe73-4385-a9dd-...
0
votes
1
answer
26
views
Trace4Cats example for Tapir endpoints
I am learning about different Scala libraries and I got to tracing. Trace4Cats claims integration with Tapir endpoints and I want to include it inside my example Play SIRD router that uses Tapir with ...
0
votes
0
answers
17
views
No Encoder found for play.api.libs.json.JsValue
I have case classes like these
case class PrimeraRemoteCopyConfig(
links: Option[Vector[JsObject]] = None,
status: Option[Vector[JsObject]] = None,
targets: Option[Vector[JsObject]] = ...
1
vote
0
answers
18
views
quartz scheduler wrongly classifying a job to recover
When I am running two instances of the application in a machine. One of the instance picks up the job for execution and other instance picks up the same job for recovery.
As per the documentation, ...
0
votes
0
answers
13
views
java.lang.RuntimeException: Settings logger used after project was loaded
i am using play framework 2.6 and sbt latest version
I ran sbt -jvm-debug 9000
and received this following error.
not sure how to solve this.
(any suggestions is welcomed in order to improve question)
...
0
votes
0
answers
29
views
How convert Cats Effect 3 to Future
I'm trying to combine Playframework with Cats Effect 3 Tagless Final style.
I'm stuck on the transformation to the Future. Play's Action requires either just value or Future, which I want to reach, ...
0
votes
0
answers
8
views
How to use playsoap in playproject for soapwebservice implementation
Could you please any one share some sample codes for implementing soap client using playsoap frame work.
-2
votes
0
answers
17
views
How to write Junit test cases for Delete API
New to playframework java and junit
Needed to write Junit for delete api built using playframework java
Azure AD Token
Request Body is passed
Please suggest good samples/tutorials links
0
votes
0
answers
44
views
Play - Cannot connect to sql server with com.microsoft.sqlserver.jdbc.SQLServerDriver
I'm working on a Play 2.8.13 project with Scala 2.12, and I want to connect to my mssql database, here's what my application.conf contains:
db.default.driver=com.microsoft.sqlserver.jdbc....
0
votes
1
answer
18
views
Play framework 1.7 puts compiled templates in root dir
I just moved an application to a new server and upgraded from Play! version 1.6 to 1.7.
In the app directory, when templates are compiled (precompiling or running), I get a lot of strange files like ...
1
vote
0
answers
29
views
How to change the variable in HTML using jQuery in MVC with Java
I'm new with MVC web-development using Java.
I can't really understand how I exchange variable values between HTML and .java controllers.
I have a radio buttons on my HTML, and depending on what user ...
0
votes
0
answers
46
views
Scala Slick subqueries and returns
I'm new to Scala with Slick library, I've work just with the Spark framework which is really strightforward with SQL sentences, and I find Slick really hard to understand. My problem is the following, ...
0
votes
0
answers
37
views
Add optional params to methods in a trait scala
I have a trait with a method that's being used by 3 different classes, in one of the classes, I would like to override the method to accept an additional param, is this possible? how would one go ...
0
votes
0
answers
31
views
@Enumerated(EnumType.STRING) is not working in play. it is still saving integer in Db
Code was working file till last month but suddenly after it is throwing error in reading string via DB (for Enum) and it is saving them as int.
Col of Enum in DB is set as varchar(255).
and this ...
0
votes
1
answer
29
views
Getting 'unable to resolve overloaded method actorRef' error when building websockets in Play + Scala
I'm trying to follow the instructions on the Play website here to set up a basic websocket. However, when trying to use the following code I'm getting an error:
Cannot resolve overloaded method '...
0
votes
0
answers
41
views
Play Framework gave NoSuchMethodError [duplicate]
I am trying to build a website with playframework and Java, and the current play version is 2.8.15.
I got a NoSuchMethodError runtime error (when responding to a simple request) but cannot tell where ...
0
votes
1
answer
43
views
com.typesafe.config.ConfigException$WrongType: system properties: path has type OBJECT rather than STRING
when i try to sbt build :
sbt run -Dhttps.port=9443 -Dhttp.port=disabled -Dhttps.keyStore.type="JKS" -Dhttps.keyStore.password="password" -Dhttps.keyStore.path=/cert/https-example....
0
votes
1
answer
43
views
How to use https in play framework?
when I use https in play framework it shows like this
WARN akka.actor.ActorSystemImpl akka.actor.ActorSystemImpl(play-dev-mode) Illegal request, responding with status '400 Bad Request': Unsupported ...
0
votes
2
answers
62
views
Scala Play Framework download failed: com.typesafe.play#play_2.10;2.2.6!play_2.10.jar
I'm working with one of the old Scala project created using Play Framework 2.2.6. I'm trying to build and run the project locally. But, facing this error whenever I run play clean compile.
[warn] ::::...
1
vote
1
answer
53
views
How to fix the No implementation for play.api.db.DBApi was bound. with play 2.8.13
we are upgrading the tech stack versions of my project due to log4j vulnerability.
SBT 1.6.2,
Scala 2.13.6,
play_scala 2.8.13
I used below dependencies to connect database and I mentioned db ...
0
votes
0
answers
23
views
Reverse Engineering an auth code query parameter passed to Play Framework in URL query Parameter
I recently got thrown into a company to do DD on a SaaS solution that needs to generate codes to send invites. Has anyone seen or used this method of passing an API key/auth code? It's using the Play ...
0
votes
1
answer
43
views
Propagate errors through a chain of Scala futures
Considering a sequence of futures each returning Either[Status, Resp].
How would you propagate error status codes through a for comprehension which is using Future and not Either?
The code bellow does ...
0
votes
0
answers
7
views
How to redirect domain from same code base Play Framework
I'm using Play Framework version 1.4
I have two domains https://domain1, https://domain2.
Both 2 domains accesss same code.
Now I need to redirect to domain2 when I access domain1.
How to config it?
0
votes
0
answers
45
views
Try to run sbt shell gives me error server failed to start error 5
I was following the tutorial for build an scalable websocket app in Heroku, following the tutorial Writing Scalable WebSocket Applications on Heroku and trying to set up Play Framework to work on ...
0
votes
0
answers
36
views
How can i use Request parameter in all methods whtout put in every method on java play framework?
Im migragating a proyect from play 2.1.5 to 2.8.13 .
When i want to get session documentation says that i should pass Request by paraemter, and for parse a json too
session
public Result index(Http....
0
votes
2
answers
51
views
Java play framework null pointer exception in reflection giving file
In java play framework project I do not figure out in retrieving file sample.txt in same package of my current controller class.
I try with this command:
URL resource = MyController.class.getResource(&...
1
vote
0
answers
14
views
Java play framework call an endpoint in routes from an inside project controller
In my java play framework project (2.3 version) I need to call an exposed endpoint from outside also from inside my project. To be more specific, in another controller.
So in my routes I have this ...
1
vote
1
answer
47
views
How to pattern match on a Future Result when it is the Action is of AnyContent type
I have a action that looks like:
def login(...): Action[AnContent] =
customActionBuilder.async { request =>
}
Now this customActionBuilder will return either:
execute the passed in block
...
0
votes
0
answers
11
views
MockWS with dynamic url
I want to parse dynamic url into case url of MockWS like this
val ws = MockWS {
case ("POST", mockServer.getUrl + "/predict-nationality") =>
Action {
...
1
vote
0
answers
23
views
Scala play framework - convert Rest API to HTTPS using .JKS file using organizational CA
Currently I am running scala play application, now it's HTTP APIs are working fine in my Angular UI application locally. But in our organization for higher environment we need to convert it to SSL ...
0
votes
0
answers
15
views
Request session present in private browser
I'm running an application using Play Framework and facing issues with the session data.
I log in with an user in Chrome, and when I try to login with another user in firefox (even in a private tab) ...
0
votes
0
answers
31
views
compiling my play scala project with openjdk 17 and openjdk 11
While compiling my play Scala project I saw the next error message:
error: error while loading String, class file '/root/.sbt/1.0/java9-rt-ext-private_build_17_0_2/rt.jar(java/lang/String.class)' is ...
1
vote
0
answers
43
views
alpakka kafka auto offset reset config latest does not read messages in test case
I have a java play application that leverages akka streams to read from kafka and output to a websocket. my application creates a kafka source using the following:
Consumer.plainSource(...
1
vote
0
answers
6
views
What is the best way to show a table in a view using PlayFramework 1.5.*?
I'm doing a play framework 1.5.* project, and I need to display some tables, that I get from a mysql database, in a view. I need to display more than one table and the way I'm currently doing it (see ...
0
votes
1
answer
31
views
SBT reference error after openapi code generation
I have a Scala / SBT multi module project where one module uses generated code from an OpenAPI specification. The module also has source code in src/main/scala.
What I need to do is this:
reference ...
1
vote
0
answers
27
views
Scala Play Framework: How to send console output of command to http response and display line by line in textarea
I want to display a console output using textarea in browser, upon button click, I run process on server and send the output to the textarea.
So far I managed to do the following:
on server:
def ...
1
vote
0
answers
31
views
PlayFramework: adding assets on compiling
in our Scala project we're using Play Framework with some static assets in the public directory, linked in the normal way:
via "routes":
GET /assets/*file controllers.Assets....
0
votes
0
answers
7
views
How to get rid of this manual step in Play framework for deployment
Environment: Windows
I'm creating a deployable zip using sbt dist and the zip folder got created in universal folder.
Later do the unzip manually. Edit the bat file and remove all the longest line and ...
1
vote
0
answers
7
views
Play framework lib folder issue
I'm developing a play framework application and using SBT to build the application and run
I have my external libraries in project/lib folder. I want to run as well as create an executable exe or jar ...
-1
votes
1
answer
15
views
Play Java - Is there a way access response in filter /print/log response body
I'm trying to figure out if there's a way to get response body in filter for PlayFramework in Java. I'm new to Java and Play and learning through logging filter from https://www.playframework.com/...
0
votes
0
answers
17
views
How to override binding in subling child submodules in scala play
I have scala play multimodule application with 3 modules: common, moduleA and moduleB where moduleA and moduleB depend on common.
ModuleA and moduleB should bind different implementation for trait ...
0
votes
1
answer
32
views
What does Action mean in play framework (Scala)?
I am new to Play Framework and was trying to understand SimpleRouter class. In the Play documentation, I see a simple example as:
val router = Router.from {
case GET(p"/hello/$to") =>
...