playframework

Mondrian OLAP connection management

旧巷老猫 提交于 2020-01-15 12:31:11
问题 What is the recommended pattern for managing Mondrian database connections? I am using Mondrian as a library in a Scala/Play Framework web application. For example: var connection try { connection = DriverManager.getConnection(connection_string).unwrap(classOf[OlapConnection]) val result = connection.createStatement.executeOlapQuery(mdx) // ... use the result ... } finally { if (connection) connection.close } Is calling close in a finally block the right approach? How do I configure a

How to add a UTF-8 String of JSON within JSON in Curl?

谁说我不能喝 提交于 2020-01-15 10:54:08
问题 I'm creating a menu for my Facebook bot by posting some JSON to their API. The payload is required to be a UTF-8 string. I would like this string to be JSON such that my server can read it easily. The following results in the error "setting_type" is required which indicates something is not being escaped properly: curl -X POST -H "Content-Type: application/json" -d '{ "setting_type" : "call_to_actions", "thread_state" : "existing_thread", "call_to_actions":[ { "type":"postback", "title":

How to add a UTF-8 String of JSON within JSON in Curl?

最后都变了- 提交于 2020-01-15 10:52:50
问题 I'm creating a menu for my Facebook bot by posting some JSON to their API. The payload is required to be a UTF-8 string. I would like this string to be JSON such that my server can read it easily. The following results in the error "setting_type" is required which indicates something is not being escaped properly: curl -X POST -H "Content-Type: application/json" -d '{ "setting_type" : "call_to_actions", "thread_state" : "existing_thread", "call_to_actions":[ { "type":"postback", "title":

Scala JavaScript Routing Play Framework

随声附和 提交于 2020-01-15 10:27:09
问题 I'm using Play framework with Scala. I'm facing a weird error and can't figure out what's the solution. The error message is: value Track is not a member of object controllers.routes.javascript <script type="text/javascript" src="@routes.TrackController.javascriptRoutes"></script> @helper.javascriptRouter("jsRoutes")( routes.javascript.Track ) def Track(id:Long)= Action {implicit request => Ok(views.html.track( new TrackData(TrackClient.getTrack(id)))) } def javascriptRoutes = Action {

Play 2.3.6 Java - OutOfMemory errors w/ sbt-uglify

有些话、适合烂在心里 提交于 2020-01-15 10:20:17
问题 I'm having an issue when trying to use the sbt-uglify plugin. I've configured the project per: https://github.com/sbt/sbt-uglify in plugins.sbt: addSbtPlugin("com.typesafe.sbt" % "sbt-uglify" % "1.0.3") in build.sbt: pipelineStages := Seq(uglify, digest, gzip) I have a non-trivial number of JS files (60+). What I've been getting is an OutOfMemory exception which prevents me from being able to complete a dist command. Has anyone else encountered this problem? Any ideas/solutions are

Play Framework - Checkbox processing

ε祈祈猫儿з 提交于 2020-01-15 10:15:35
问题 How do I process a checkbox input in Play! Framework? Should I catch the value as a String at the controller? How to get what values are checked by a user? This is the html code of my checkbox #{list items:categories, as:'category'} <tr> <td><input type="checkbox" name="category" id="category-${category.name}" value="${category.id}" /><label for="category-${category.name}"> ${category.name}</label></td> </tr> #{/list} 回答1: I think if you have a List<String> category in your form action, you

Play 2.5 with Silhouette 4.0 - Credential Provider

。_饼干妹妹 提交于 2020-01-15 10:14:53
问题 I am trying to write a sample app with Play 2.5 using Silhouette 4.0 for user/password authentication. Source code available at : https://github.com/pariksheet/dribble I am stuck at setting requestProvider in Environment object Environment[JWTEnv]( identityService, authenticatorService, Seq(), eventBus ) As I am not able to figure out the solution, I am injecting Credential Provider in my all controller classes. class MyController @Inject() (val messagesApi: MessagesApi,val silhouette:

Play 2.5 with Silhouette 4.0 - Credential Provider

喜欢而已 提交于 2020-01-15 10:12:34
问题 I am trying to write a sample app with Play 2.5 using Silhouette 4.0 for user/password authentication. Source code available at : https://github.com/pariksheet/dribble I am stuck at setting requestProvider in Environment object Environment[JWTEnv]( identityService, authenticatorService, Seq(), eventBus ) As I am not able to figure out the solution, I am injecting Credential Provider in my all controller classes. class MyController @Inject() (val messagesApi: MessagesApi,val silhouette:

Java + Play Framework 2 with nested action compositions in the same class

你离开我真会死。 提交于 2020-01-15 09:09:10
问题 I was looking how to implement a filter in Play Framework 2 and, for the best of my knowledge, the best approach is to implement that using action composition. That said, I started doing some testing and I was able to make that to work. The only limitation is when I have nested annotations in the same class. My current use case Perform domain validation when domain parameter is present in the request. If the domain is not present in the local database, perform syntax validation only.

Error Deploying to Heroku Play 2.2 app

回眸只為那壹抹淺笑 提交于 2020-01-15 08:09:08
问题 I think i am having a problem in my Procfile. The deploy is compiled successfully but the app does not start with this message -- 2014-03-27T14:17:06.465302+00:00 heroku[api]: Deploy ea0e14d by xxxx@gmail.com 2014-03-27T14:17:06.465378+00:00 heroku[api]: Release v10 created by xxxx@gmail.com 2014-03-27T14:17:14.091032+00:00 heroku[web.1]: Starting process with command `target/universal/stage/bin/enigmatic-dusk-7498 -Dhttp.port=32253` 2014-03-27T14:17:15.199466+00:00 app[web.1]: bash: target