playframework

Play Scala and thread safety

被刻印的时光 ゝ 提交于 2021-02-07 15:40:15
问题 The project is written using Play framework and Scala language. I have implemented compile time dependency . I have followed this example from Play: https://github.com/playframework/play-scala-compile-di-example Looking at the MyApplicationLoader.scala : import play.api._ import play.api.routing.Router class MyApplicationLoader extends ApplicationLoader { private var components: MyComponents = _ def load(context: ApplicationLoader.Context): Application = { components = new MyComponents

Change proxy settings in play framework

落花浮王杯 提交于 2021-02-07 09:44:53
问题 I was behind a proxy when I setup play framework. I edited the ~/.activator/activatorconfig.txt file and it worked fine. Now I need to remove that proxy to work on a different network. I commented out the line but the activator script still tries to use the proxy for connection, when I run ./activator new (or ./activator ui). The file currently looks like this # This are the proxy settings we use for activator # Multiple proxy hosts can be used by separating them with a '|' sign # Do not

Change proxy settings in play framework

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-07 09:44:29
问题 I was behind a proxy when I setup play framework. I edited the ~/.activator/activatorconfig.txt file and it worked fine. Now I need to remove that proxy to work on a different network. I commented out the line but the activator script still tries to use the proxy for connection, when I run ./activator new (or ./activator ui). The file currently looks like this # This are the proxy settings we use for activator # Multiple proxy hosts can be used by separating them with a '|' sign # Do not

Play 2.x @ sign in route definitions

瘦欲@ 提交于 2021-02-04 15:54:45
问题 I'm learning the Play! framework (2.3.x). I am confused about the meaning of the '@' character in front of the controller in route definitions like this: POST /myresource/:id/custom @controllers.MyResource.custom(id: Long) As much as I can infer from the context I've seen this in, it probably has to do with the exact controller implementation (object vs class). Or am I completely wrong in this? I can't find anything in the docs and the code I've seen isn't exactly explanatory. Can anyone

Play Framework Java: Mock using Mockito: Wanted but not invoked, Actually, there were zero interactions with this mock

ぐ巨炮叔叔 提交于 2021-02-04 08:36:09
问题 I am new to Mockito and Play Framework, so can anyone suggest a solution for this: I have 3 classes as follows: I have a Play application where I am calling a helper method, which indeed calls an ApiClient, which calls an external api and fetches the results and returns CompletionStage of that result. And the helper method indeed returns the same result to the controller. The Code is as follows. public class MyController extends Controller{ @Inject WSClient wsClient; MyControllerHelper

How do you view contents of play 2.7 H2 database using h2-browser?

帅比萌擦擦* 提交于 2021-01-29 04:14:46
问题 How do you view the contents of an embedded H2 database, in Play 2.7? Prior research: It seems the steps should be to run sbt shell . Then run h2-browser and sbt run so they are in the same process? If using slick, then call an endpoint to trigger compilation/database creation. With a configuration of db.default.driver=org.h2.Driver db.default.url="jdbc:h2:mem:play" db.default.user=sa db.default.password="" I connects, but cannot authenticate. Multiple usr/password combinations tried. Wrong

How do you view contents of play 2.7 H2 database using h2-browser?

偶尔善良 提交于 2021-01-29 04:08:21
问题 How do you view the contents of an embedded H2 database, in Play 2.7? Prior research: It seems the steps should be to run sbt shell . Then run h2-browser and sbt run so they are in the same process? If using slick, then call an endpoint to trigger compilation/database creation. With a configuration of db.default.driver=org.h2.Driver db.default.url="jdbc:h2:mem:play" db.default.user=sa db.default.password="" I connects, but cannot authenticate. Multiple usr/password combinations tried. Wrong

One of the example projects listed by Lightbend is not working for larger files

不问归期 提交于 2021-01-28 21:54:29
问题 I did post this same question at LightBend's discussion group here, but cannot get an answer that solves my issue. Since I am really anxious to know what is the problem here, let me again post this question here, hoping a big audience group might mean a better chance of getting an answer. So basically, at this page, https://developer.lightbend.com/start/?group=play, we can find a list of example Play! projects. Among these examples, there is one project is about Java File Upload (https:/

sbt can not find the ebean dependency (Some unresolved dependencies have extra attributes)

五迷三道 提交于 2021-01-28 14:42:09
问题 I created new play-java application by using command from play website sbt new playframework/play-java-seed.g8 Then added EBean dependencies like below (link): addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "4.0.1") And see below message. How in sbt can I verify what exactly is wrong? :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: com.typesafe.sbt#sbt-play-ebean;4.0.1: not found [warn] :

sbt can not find the ebean dependency (Some unresolved dependencies have extra attributes)

我与影子孤独终老i 提交于 2021-01-28 14:32:52
问题 I created new play-java application by using command from play website sbt new playframework/play-java-seed.g8 Then added EBean dependencies like below (link): addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "4.0.1") And see below message. How in sbt can I verify what exactly is wrong? :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: com.typesafe.sbt#sbt-play-ebean;4.0.1: not found [warn] :