playframework-2.2

How do I describe a bridge table to Ebean?

霸气de小男生 提交于 2019-12-06 22:40:19
问题 Lets say I have these tables: ORDER: id ITEM: id ORDER_ITEM: order_id, item_id The table: ORDER_ITEM is a bridge table between ORDER and ITEM . How do I describe this threesome to Ebean ? I would prefer not to use raw SQL so that I can still create and update these entities. UPDATE Sat Nov 9 02:32:40 UTC 2013 Ok, lets make this problem harder and more representative of my actual situation. The column names dont fit the convention: ORDER: order_number ITEM: item_number ORDER_ITEM: my_order, my

Purely Dynamic forms using play framework

别说谁变了你拦得住时间么 提交于 2019-12-06 13:42:37
I have a Play 2.2 application which gets, thru an external web service, a JSON with field name, type and constraints info ; the content of this JSON can be different every time (though the overall structure stays same, with just the difference in number of fields etc.). Now the requirement is to render a HTML form based on the field definition received. Can someone advise what would be the best way to do this (I don't think the usual play-forms can be very useful here, unless someone can tell how to create a dynamic Mapping , Form objects). One of the ideas I had was to send the JSON to client

Play Framework: Handling dynamic created files (images) in PRODUCTION mode

一个人想着一个人 提交于 2019-12-06 11:59:09
I'm trying to allow users to upload photos to the server and then view them (all users can view all photos) in production (NOT development). While in development mode everything is simple - I can upload the files to the public folder and then read then from there, in production mode I don't have access to the public folder anymore (as this approach is for static accesses and not dynamic). So, I have 2 issues: Upload: currently I can't understand how to save the uploaded photos to a specific folder, without using an absolute path to the location where I want the photos to be saved. Here is the

Play war deployment prevents Tomcat from stopping

南笙酒味 提交于 2019-12-06 11:18:24
I am currently experiencing some onStop issues with my play application under Tomcat. I am using play 2.2.2, sbt 0.13.0, scala 2.10.4 and Tomcat 7 and jdk1.6. To create a war file I am using the play2war plugin(1.2) with: Play2WarKeys.servletVersion := "2.5" So deploying and running the application as well as Tomcat itself is running without any issues. But as soon as I try to stop the server with the default shutdown.sh I get SEVERE: The web application [/WEBSERVICE] appears to have started a thread named [play-scheduler-1] but has failed to stop it. This is very likely to create a memory

Play Framework send message via rabbit mq

不想你离开。 提交于 2019-12-06 07:32:27
问题 Does anybody out there using rabbitmq with Play Framework? I have an AI written in Scala using Play Framework. And I have a mean stack, which handles a nosql database. I'd like to send json messages via rabbitmq to that AI. I already got things going with nodejs and rabbitmq, but now that i want to connect to play I might need your help. Has someone any experience with rabbitmq and play or some practical Advices? Thanks! 回答1: You can use the standard Java library to send messages to RabbitMQ

Play Framework 2.2.x multiple route files

一笑奈何 提交于 2019-12-06 07:30:48
问题 I've read through the Play! For Scala book's section on modules and I can't seem to figure out how to import the routes from a referenced module. I've set up my module as a library dependency in my build.sbt file and I've tried to import the route in my routes file like so build.sbt: libraryDependencies ++= Seq( "org.webjars" %% "webjars-play" % "2.2.0", "default" % "mymodule" % "1.0-SNAPSHOT" routes ... -> /api/mymodule mymodule.routes mymodule contains a routing file called mymodule.routes.

build.sbt defining project dependency between modules

醉酒当歌 提交于 2019-12-06 07:23:17
I have project in PlayFramework. It has one main project without any code/logic. And it have few submodules: main: admin common shop Modules: admin and shop will base on common module (classes like: user, role, permission), so I have to configure it that way: lazy val shop = project.in(file("modules/shop")) .dependsOn(cirs) .dependsOn(common) .dependsOn(admin) lazy val admin = project.in(file("modules/admin")) .dependsOn(cirs) .dependsOn(common) .dependsOn(shop) But in module common I have view where I wonna display links (a href...) to other submodules. To do this I have to use reverse

Error reading annotations play framework 2.2

吃可爱长大的小学妹 提交于 2019-12-06 04:01:25
问题 I have started to learn the Play Framework, following the Java guide (tutorial “ZenTasks”). Everything was going well until I found this error: Error reading annotations for models.Task Class package models; import java.util.*; import javax.persistence.*; import play.db.ebean.*; @Entity public class Task extends Model { @Id public Long id; public String title; public boolean done = false; public Date dueDate; @ManyToOne public User assignedTo; public String folder; @ManyToOne public Project

DdlGenerator constructor needs no arguments?

会有一股神秘感。 提交于 2019-12-06 00:02:57
I wanted to unit test my database operation and I found this code . However, I get the followin error: [CityGame] $ test [info] Compiling 2 Java sources to /Users/pmichna/Documents/code/citygame/target/scala-2.10/test-classes... [error] /Users/pmichna/Documents/code/citygame/test/models/BaseModelTest.java:31: error: constructor DdlGenerator in class DdlGenerator cannot be applied to given types; [error] ddl = new DdlGenerator((SpiEbeanServer) server, new MySqlPlatform(), config); [error] ^ [error] required: no arguments [error] found: SpiEbeanServer,MySqlPlatform,ServerConfig [error] reason:

when I run the play framework example with sbt some error

心不动则不痛 提交于 2019-12-05 18:31:01
My operating system is Windows 8 , I downloaded the Play framework 2.2 without activator. I tried to build it by sbt. When I am under the zentask directory: I run sbt and the error is: C:\testprojects\zentasks>sbt last [error] java.lang.NullPointerException [error] Use 'last' for the full log. Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? last java.lang.NullPointerException at sbt.StringUtilities$.nonEmpty(StringUtilities.scala:12) at sbt.impl.GroupArtifactID.$percent(DependencyBuilders.scala:50) at $15f60aabe1897273e9e3$.$sbtdef(C:\testprojects\zentasks\project\plugins.sbt:8)