playframework

How to use play frameworks Secure module to login a user after that user has been created

有些话、适合烂在心里 提交于 2020-02-21 10:23:44
问题 I am using the "Secure" module from play framework and its mostly working great. I can login a user by posting a from the the /login route in my application. However, when I "create/signup" a new user, I would like for that user to be automatically logged in after user creation. This, I can't seem to get working programmatically, i.e., by not having to post a form to login. My current code for my user create action is like: public static void create(@Required @Email String email, @Required

Kafka Consumer in play framework using java

安稳与你 提交于 2020-02-16 10:43:11
问题 I have searched thousands of sites for kafka consumer example in play framework in java language. But not able to find any example. Can anyone provide details on how to write a service which consumes topics produced by kafka continuously. Thanks 回答1: Play is a web-framework. The underlying Actor system relies on Akka. The Akka Kafka API is called Alpakka, so I suspect you are searching in the wrong keywords To combine both Akka and Play w/ Kafka, you can even use the Lagom Framework Otherwise

Play doesn't convert java-list to scala-list

会有一股神秘感。 提交于 2020-02-07 03:44:08
问题 I have a controller which hands a java-list of model-objects to the view exactly the way like it's done in the examples. The compiler throws an error that it can't convert from java.util.List to scala.collection.immutable.List . I have no clue what I should do. [error] /myapp/myappsubprojects/frontend/app/controllers/frontend/MyController.java:15: error: method render in class linklist cannot be applied to given types; [error] return ok(linklist.render("link test", Link.findAll())); [error] ^

Operation on List after flatten

大城市里の小女人 提交于 2020-02-06 07:42:13
问题 I perform a flatten operation on a Seq[JsValue] like: var rows = (response \\ "rows").head.as[List[List[String]]].flatten to get the following output: List(AA , BB , CC ,...) Basically the response I receive from JSON is that way, so extra spaces will be present to the end of all values. What I actually desire for is: List(AA, BB, CC, ...) Is it possible to perform any operation before/instead of flatten to get what I want to achieve? I tried a flatMap and the results were not too desirable.

Operation on List after flatten

ぐ巨炮叔叔 提交于 2020-02-06 07:42:05
问题 I perform a flatten operation on a Seq[JsValue] like: var rows = (response \\ "rows").head.as[List[List[String]]].flatten to get the following output: List(AA , BB , CC ,...) Basically the response I receive from JSON is that way, so extra spaces will be present to the end of all values. What I actually desire for is: List(AA, BB, CC, ...) Is it possible to perform any operation before/instead of flatten to get what I want to achieve? I tried a flatMap and the results were not too desirable.

How to exclude/excludeAll com.google.code.findbugs from a Play application?

家住魔仙堡 提交于 2020-02-06 06:12:54
问题 I have a play2.4.3 application. I'm trying to exclude com.google.code.findbugs library when I distribute my application (using activator dist command). I don't directly include it, here is how I think it's included in the project: http://mvnrepository.com/artifact/com.typesafe.play/play-java_2.10/2.4.3 depends on: http://mvnrepository.com/artifact/org.reflections/reflections/0.9.9 depends on: http://mvnrepository.com/artifact/com.google.code.findbugs/annotations/2.0.1 I want to use sbt's

How to exclude/excludeAll com.google.code.findbugs from a Play application?

女生的网名这么多〃 提交于 2020-02-06 06:12:52
问题 I have a play2.4.3 application. I'm trying to exclude com.google.code.findbugs library when I distribute my application (using activator dist command). I don't directly include it, here is how I think it's included in the project: http://mvnrepository.com/artifact/com.typesafe.play/play-java_2.10/2.4.3 depends on: http://mvnrepository.com/artifact/org.reflections/reflections/0.9.9 depends on: http://mvnrepository.com/artifact/com.google.code.findbugs/annotations/2.0.1 I want to use sbt's

How to exclude/excludeAll com.google.code.findbugs from a Play application?

荒凉一梦 提交于 2020-02-06 06:11:02
问题 I have a play2.4.3 application. I'm trying to exclude com.google.code.findbugs library when I distribute my application (using activator dist command). I don't directly include it, here is how I think it's included in the project: http://mvnrepository.com/artifact/com.typesafe.play/play-java_2.10/2.4.3 depends on: http://mvnrepository.com/artifact/org.reflections/reflections/0.9.9 depends on: http://mvnrepository.com/artifact/com.google.code.findbugs/annotations/2.0.1 I want to use sbt's

How to delete an ManyToMany related object when one part is empty?

房东的猫 提交于 2020-02-04 07:35:32
问题 Here is the BlogPost model : @Entity @Table(name = "blog_posts") public class BlogPost extends Model { @Required @MaxSize(50) @MinSize(3) @Column(length=50) public String title; @Lob @Required @MaxSize(10000) public String description; @Temporal(TemporalType.TIMESTAMP) public Date created; @ManyToMany(targetEntity=PostTag.class, cascade=CascadeType.DETACH) @OrderBy("name ASC") public List<PostTag> tags; // + other fields } And the PostTag : @Entity @Table(name = "post_tags") public class

Are Play framework controller actions synchronized?

时光总嘲笑我的痴心妄想 提交于 2020-02-02 06:27:12
问题 I was testing some code recently and was a little surprised when I noticed only one thread was active at a time per controller action/method. For example, consider the following 2 actions for a controller: public static void testThread() { Logger.info("Start"); try { Logger.info("Sleeping..."); Thread.sleep(30000); } catch (Exception e) { } Logger.info("End"); } public static void testThread2() { Logger.info("Start"); try { Logger.info("Sleeping..."); Thread.sleep(30000); } catch (Exception e