playframework-2.0

play2 calling controllers, models, views in submodule

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 02:34:43
问题 Trying to split my project to few submodules. I've created submodules: /modules/common /modules/shopping Now I am trying convert name spaces to new one including new structure. my controller: package controllers.common; public class Index extends Controller {} my model: package models.common; @Entity public class AppMode {} my view: @(AppModeForm: Form[models.common.AppMode], CurrentMode: Boolean) @helper.form(common.routes.CMS.appModeSubmit, 'id -> "form") {} And I am getting errors all the

Redirect Play Framework 2 output to Eclipse console

荒凉一梦 提交于 2019-12-25 01:46:58
问题 I'm trying to set up Eclipse (Kepler) to work with Play Framework 2 (2.2.2 RC). I've followed the docs and everything seems fine, the code is reloaded nicely and I can debug properly from Eclipse using a Java Remote Application configuration. Thus far, after some hours of trials, the only (dreadful) problem is that I can't see any output printed onto the Eclipse console (and the application IS logging on the stout). Both the Play application and Eclipse are running on the same host. The Java

Logs not showing up Scala Play 2.3.x

核能气质少年 提交于 2019-12-24 18:05:57
问题 I am trying to my logs to show up in my play console. Here is an example of a controller I am trying to log information from : import play.api.Logger object LandingPage extends Controller { import ComponentRegistry._ private val emailForm = Form(mapping("id" -> optional(of[Long]), "emailAddress" -> email)(Email.apply _)(Email.unapply _)) def index = Action { Logger.info("Index method inside of LandingPage") Ok("INDEX") } def submit = Action { implicit request => Logger.info("Inside of submit

JSON not being parsed correctly by Play Framework

我怕爱的太早我们不能终老 提交于 2019-12-24 17:27:57
问题 I have the following code which I'm using to try and parse some JSON into a Scala case class: val json = """{"hits": [ {"created_at":"2016-02-01T15:01:03.000Z","title":"title","num_comments":778,"parent_id":null,"_tags":["story","author","story_11012044"],"objectID":"11012044","_highlightResult":{"title":{"value":"title","matchLevel":"full","matchedWords":["title"]},"author":{"value":"author","matchLevel":"none","matchedWords":[]},"story_text":{"value":"Please lead","matchLevel":"none",

Problems with Scala Play Framework Slick Session

こ雲淡風輕ζ 提交于 2019-12-24 17:06:02
问题 I'm creating an application in Scala using Play 2.2. I'm using play-slick 0.5.0.8 as my MySQL DB connector. I have the following application controller: package controllers import models._ import models.database._ import play.api._ import play.api.mvc._ import play.api.Play.current import play.api.db.slick._ object Application extends Controller { // WORKS: def test = DBAction { implicit session => Ok(views.html.test(Cameras.findById(1))) } // DOES NOT WORK: def photo = Action { val p =

How to change text in SecureSocial

♀尐吖头ヾ 提交于 2019-12-24 17:02:03
问题 I'm wondering how to change text in SecureSocial views... I've created file messages.en in the conf directory... but it does not work. If I want my text and other stuff like copyright notice, shall I create my own custom views? Thanks. 来源: https://stackoverflow.com/questions/14696385/how-to-change-text-in-securesocial

sbt cannot resolve ensime-sbt-cmd in a Play2-Scala project

南楼画角 提交于 2019-12-24 16:34:16
问题 I'm trying to configure Sublime Text 2 to better support working with Scala and Play! 2 Framework by following instructions from http://engineering.panaxiom.co.uk/post/34631917299/sublime-text-2-with-sbt-and-play-2. (I made just one change: I updated the plugin version to 0.1.1.) I was able to almost complete the steps given in the tutorial but the second one always fails (generate ensime config file) simply because sbt is unable to resolve ensime-sbt-cmd plugin (when I enter a project

Play 2.0 doesn't run all tests

两盒软妹~` 提交于 2019-12-24 15:57:53
问题 I'm porting an application over to Play 2.0 and for some reason it's not running all the tests. It finds all the test classes. But just doesn't run any tests in most of them. I tried moving the classes to the base of tests directory, but that didn't make a difference. The tests it doesn't run contain tests for the persistence using hibernate JPA. The classes have a common base class for managing the database state across tests. I'm expecting the persistence tests to blow up spectacularly but

Play Framework with IntelliJ Community Edition 14

夙愿已清 提交于 2019-12-24 15:49:42
问题 I have not managed to compile/debug etc. the current Play Framework (2.3.7) with the Community Edition 14 of IntelliJ. Neither by importing the project, nor by using gen-idea . Is there any way to get it run or is there just no way to use it ? Paying > 400 bucks for just this feature is simply too much. Thanks. 回答1: Usually I compile and run through console: activator -> compile/run , but you can compile in Intellij too by running Build -> Make Project , but I never tried running Play in

Playframework 2.1 slow resolving of internal dependencies

你说的曾经没有我的故事 提交于 2019-12-24 14:33:49
问题 We're using a in house sonatype repository for our own libraries which our play project depend upon. Lately the project have been taking around 10 minutes to start (using play run) because the resolving is slow. Trying to see what's happening I'm running a ngrep port 80 . I see alot of slow responses from the typesafe repository which answer that our own libraries isn't in their repo. Example: T <my-internal-ip>:41907 -> 54.236.91.228:80 [AP] HEAD /typesafe/snapshots/<our-pom-file-here> HT TP