playframework-2.3

Scheduling/delaying of jobs/tasks in Play framework 2.x app

做~自己de王妃 提交于 2019-12-05 07:09:34
In a typical web application, there are some things that I would prefer to run as delayed jobs/tasks . They tend to have some or all of the following properties: Takes a long time (anywhere from multiple seconds to multiple minutes to multiple hours). Occupy some resource heavily (CPU, network, disk, external API limits, etc.) Result not immediately necessary. Can complete HTTP response without it. OK (and possibly even preferable) to delay until later. Can be (and possibly preferable to) run on (a) different machine(s) than web server(s). The machine(s) are potentially dedicated job/task

Play Framework 2.3.7: Static assets location not working in production

泄露秘密 提交于 2019-12-05 05:28:54
I have seen a few questions on this but cant seem to get to the bottom of it. I have a Play Framework 2.3.7 (Activator 1.2.12) site, when I run it in dev mode everything works fine. When I start it in production mode I get the following errors: [app] $ start [info] Wrote C:\Users\App\git\website2.0\target\scala-2.10\app_2.10-1.0- SNAPSHOT.pom [info] Main Scala API documentation to C:\Users\App\git\website2.0\target\scala- 2.10\api... [info] Compiling 57 Scala sources and 58 Java sources to C:\Users\App\git\websit e2.0\target\scala-2.10\classes... [error] C:\Users\App\git\website2.0\target

Play Framework 2.3 and GAE - Google App Engine

大兔子大兔子 提交于 2019-12-04 23:50:23
Is there any sample application that uses Play Framework 2.3 and Google App Engine? So far I have found this one: https://github.com/siderakis/playframework-appengine Here is another tutorial with example: http://viralpatel.net/blogs/first-play-framework-gae-siena-application-tutorial-example/ 来源: https://stackoverflow.com/questions/24069774/play-framework-2-3-and-gae-google-app-engine

Publish asset files of play framework plugin

泄露秘密 提交于 2019-12-04 20:07:39
using publishTo in build.sbt file, it can be automation the publishing progress . But asset files( in public folder) does not packaged. how to package and publish asset files? For locally publishing assets files , add this snippet in build.sbt file import play.PlayImport.PlayKeys._ packagedArtifacts in publishLocal := { val artifacts: Map[sbt.Artifact, java.io.File] = (packagedArtifacts in publishLocal).value val assets: java.io.File = (playPackageAssets in Compile).value artifacts + (Artifact(moduleName.value, "jar", "jar", "assets") -> assets) } Important notes in last function line: first

How to integrate Sass and Play 2.3?

吃可爱长大的小学妹 提交于 2019-12-04 19:15:11
问题 Is it possible to integrate Sass and Play Framework 2.3, so that Sass gets compiled to CSS? If so, how should I go about it? I've tried the play-sass plugin, but it doesn't build with Play 2.3, only up to 2.2. 回答1: As you probably know, Play has migrated to using sbt-web as the model for its asset pipeline, instead of the old system. It's much more flexible than the old system. Unfortunately, since it's so new, it also lacks whole lot of existing packages. You'll either have to write sbt-sass

How to set up asset fingerprinting in Play 2.3.4?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 16:13:18
问题 Versions: play 2.3.4 sbt 0.13.1 scala 2.11.2 I've followed the documentation on playframework.com to enable fingerprinting on public assets, but calls to routes.Assets.versioned never produce a versioned filename with a digest hash. Relevant lines in build.sbt: scalaVersion := "2.11.2" pipelineStages := Seq(rjs, digest) Relevant lines in project/plugins.sbt: addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.4") addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.5") addSbtPlugin("com

Are there major scaling limits with play framework and jdbc blocking io calls

左心房为你撑大大i 提交于 2019-12-04 10:43:36
I am using the playframework (2.4) for Java and connecting it to Postgres. The play framework is being used as a restful service and all it is doing is insert,updates,reads and deletes using JDBC. On this play page https://www.playframework.com/documentation/2.3.x/JavaAsync it states clearly that JDBC is blocking and that play has few threads. For the people who know about this, how limiting could this be and is there some way I can work around this? My specific app can have a few hundred database calls per second. I will have all the hardware and extra servers but do not know how play can

Dealing with failed futures

 ̄綄美尐妖づ 提交于 2019-12-04 09:24:30
In Play Framework 2.3, an action can produce a result from a successful future call like this: def index = Action.async { val futureInt = scala.concurrent.Future { intensiveComputation() } futureInt.map(i => Ok("Got result: " + i)) } But how can an action deal with a failed future call, i.e., a future that was completed by calling failure() instead of success() ? For instance, how could an action produce a InternalServerError result with the message returned in the future's failure's throwable? onComplete and onFailure callbacks don't seem to fit the action's flow (it needs to return a result,

right usage of slick filter

血红的双手。 提交于 2019-12-04 09:15:26
I'm using slick to access database. I want to query like this: case class Coupon(couponId: Long, shopId: String) class Coupons(tag: Tag) extends Table[Coupon](tag, "coupons"){ def couponId = column[Long]("coupon_id") def shopId = column[String]("shop_id") override def * = (couponId, shopId) <> (Coupon.tupled, Coupon.unapply) } object Coupons extends TableQuery(new Coupons(_)){ def findCouponBy(couponId: Long, shopId: Option[String]) = { val s = DB.createSession() try { val q = for { coupon <- this.filter(c => c.couponId === couponId && shopId.map(s => c.shopId === s).getOrElse(true) } yield

Play Framework - Register a custom DataBinder for dynamic fields

血红的双手。 提交于 2019-12-04 07:05:45
问题 Using Play 2.3.7 (Java) I have the following scenario. I have a class CSVData which contains a list of type CSVField . Here are the attributes for these classes: public class CSVData{ private String name; private String description; private String dataFilePath; private List<CSVField> fields; private Double latitude; private Double longitude; // rest of class... } and public class CSVField { private String name; private String type; ...} The difficulty when making a form to input CSVData is