playframework

Unable to return JSON response using Play Framework and Postgresql?

99封情书 提交于 2020-01-11 11:43:32
问题 I am trying to return JSON response data from Postgresql database using Play framework(Scala). I have tried the following where I am not able to return my json response output. I have couple of JSON objects in my database table: jsondata , which is having id and name . I have written some println messages, those are coming as None, don't know why ? The compiler error says Missing parameter either [id] or [name] I am not sure what I am doing wrong in my code to get JSON response output for my

Unable to return JSON response using Play Framework and Postgresql?

 ̄綄美尐妖づ 提交于 2020-01-11 11:43:08
问题 I am trying to return JSON response data from Postgresql database using Play framework(Scala). I have tried the following where I am not able to return my json response output. I have couple of JSON objects in my database table: jsondata , which is having id and name . I have written some println messages, those are coming as None, don't know why ? The compiler error says Missing parameter either [id] or [name] I am not sure what I am doing wrong in my code to get JSON response output for my

Use @JsonView to exclude (like @JsonIgnore) with play frameworks default json writer?

寵の児 提交于 2020-01-11 11:34:09
问题 It seems you can't mix @JsonIgnore and @JsonView. I want to hide a field by default, but show it in some cases. Basically I've got this setup :- class Parent extends Model { public Long id; public Child child; } class Child extends Model { public Long id; @JsonView(Full.class) public String secret; public static class Full {}; } And want to use play.libs.Json.toJson(parent) to render WITHOUT child.secret, and ObjectMapper objectMapper = new ObjectMapper(); ObjectWriter w = objectMapper

How to put Play! controllers in an arbitrary sub-package

我的未来我决定 提交于 2020-01-11 08:46:47
问题 I'm using the Play Framework for a web app in Java. I'd like to put an Account controller in an "account" subpackage, for example: |- controllers |- account |- Account.java While my views are organized like: |- views |- Account |- index.html The Account.java file contains: package controllers.account; import play.mvc.Controller; public class Account extends Controller { public static void index() { render(); } } I'd like to have the following behavior: when a request is made to http:/

Batch HTTP requests in Play!Framework

こ雲淡風輕ζ 提交于 2020-01-11 07:30:20
问题 I have the current set of of routes implemented (for example): GET /api/:version/:entity my.controllers.~~~~~ GET /api/:version/:entity/:id my.controllers.~~~~~ POST /api/:version/:entity my.controllers.~~~~~ POST /api/:version/:entity/:id my.controllers.~~~~~ DELETE /api/:version/:entity my.controllers.~~~~~ POST /api/:version/search/:entity my.controllers.~~~~~ And they work beautifully. Now let's say I want to implement a "batch endpoint" for the same API. It should look something like

why is play framework timing out?

流过昼夜 提交于 2020-01-10 12:05:59
问题 I am starting the the application from the command line using either activator run activator ~run or after I start the activator console I use run or ~run. everything seems to work and it gives the expected --- (Running the application, auto-reloading is enabled) --- play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000 (Server started, use Ctrl+D to stop and go back to the console...) I can view the application in the browser and I can make changes in the code and they are reloaded just fine.

why is play framework timing out?

半腔热情 提交于 2020-01-10 12:05:08
问题 I am starting the the application from the command line using either activator run activator ~run or after I start the activator console I use run or ~run. everything seems to work and it gives the expected --- (Running the application, auto-reloading is enabled) --- play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000 (Server started, use Ctrl+D to stop and go back to the console...) I can view the application in the browser and I can make changes in the code and they are reloaded just fine.

why is play framework timing out?

自作多情 提交于 2020-01-10 12:04:45
问题 I am starting the the application from the command line using either activator run activator ~run or after I start the activator console I use run or ~run. everything seems to work and it gives the expected --- (Running the application, auto-reloading is enabled) --- play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000 (Server started, use Ctrl+D to stop and go back to the console...) I can view the application in the browser and I can make changes in the code and they are reloaded just fine.

How can I influence the redirect behavior in a play-controller?

核能气质少年 提交于 2020-01-10 01:06:11
问题 In play you always follow the Redirect-After-Post-Pattern if you call from a public-method of a controller. This is in most cases a good behavior, but sometime it could be nasty. So I tried to find out how it works in play 1.1!: The basic is some byte-code-enhancement, which is done in play.classloading.enhancers.ControllersEnhancer . There you can find that there still exists some exceptions of the default behavior: If your method is annotated by an annotation from the package play.mvc , for

How can I influence the redirect behavior in a play-controller?

巧了我就是萌 提交于 2020-01-10 01:05:53
问题 In play you always follow the Redirect-After-Post-Pattern if you call from a public-method of a controller. This is in most cases a good behavior, but sometime it could be nasty. So I tried to find out how it works in play 1.1!: The basic is some byte-code-enhancement, which is done in play.classloading.enhancers.ControllersEnhancer . There you can find that there still exists some exceptions of the default behavior: If your method is annotated by an annotation from the package play.mvc , for