playframework

Why is there a build.gradle and a build.sbt in play framework?

纵然是瞬间 提交于 2020-01-14 07:28:41
问题 I'm starting to develop a web app with scala. What I don't understand is why we have a build.gradle file and a build.sbt file. There are dependencies defined in both files. Which one should I use in what case? 回答1: The files are equivalent, and that is why they both declare (almost) the same dependencies. So you can use Gradle or sbt, but you won't need to use both. If you want to use Gradle, just remove build.sbt . If you want to use sbt, just remove build.gradle . They are both present in

Simple Microservice framework [closed]

大憨熊 提交于 2020-01-14 06:31:11
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . For a while I was looking for a fast and simple solution for a microservice framework. I am quite new to all Lightbend products & scala but since its looks very interesting I decided to give it a try. Few Questions: 1) I don’t understand why there is a need for the new framework

Play framework Twirl template comparing javascript element and scala variable

走远了吗. 提交于 2020-01-14 03:59:45
问题 As shown in the code sample below I want to compare a javascript element inside a scala helper element. However it always returns false even when the element "abcde" is present. How can I get the javascript value inside the scala helper element other than using tags? @(appSeq:Seq(String)) <script> var app = 'abcde' @if(appSeq.contains(<script>app</script>)) { alert('true'); } else { alert('false'); } </script> 回答1: It is not possible for this reason: var app = 'abcde' is evaluated in the JS

playframework - how to automatically increment evolutions

核能气质少年 提交于 2020-01-14 03:50:10
问题 So I'm using playframework 2.0 and my application is ready for release. as I have been developing I have noticed that: conf\evolutions\default\1.sql has been automatically changing each time I add/modify my model layer. As I am about to release my application I was wondering how do I set this to start adding it to 2.sql instead of 1? I would like to tag/branch the revision so that if I need to upgrade my release in the future the system will notice that it has 1.sql installed so it will only

serialize list<object> with manytoone & onetomany relational to json

雨燕双飞 提交于 2020-01-14 03:24:06
问题 I have class Menu, it's a self to self with manytoone and onetomany relational. package models; import java.util.*; import javax.persistence.*; import play.db.ebean.*; import play.data.format.*; import play.data.validation.*; import static play.data.validation.Constraints.*; import javax.validation.*; import org.codehaus.jackson.annotate.JsonBackReference; import org.codehaus.jackson.annotate.JsonIgnore; import org.codehaus.jackson.annotate.JsonManagedReference; import com.avaje.ebean.*;

Play! Framework 2 REST Authentication and Authorization for Android Client

旧街凉风 提交于 2020-01-13 16:55:47
问题 I'm currently working on an application that has web version (Play! Framework 2.2.x) and Android Client. Due to the fact that Play! is fully RESTful I want to communicate between Play! and Android with JSON requests and responses. Web version of the application is using Play Authenticate plugin which supports authentication and authorization. I would like to know how to enable login in Android Client that would use Play! app and how to secure the communication between Play! app and Android

playframework, input disabled breaks play from passing the value?

杀马特。学长 韩版系。学妹 提交于 2020-01-13 16:28:19
问题 I have an input field that is filled in from a previous form(so the input is set to disabled on the second page) and we receive null for the value then. This works: <input type="text" class="boxtpl" name="${field.name}" value="${user?.email}"> but this doesn't: <input type="text" class="boxtpl" name="${field.name}" value="${user?.email}" disabled="disabled"> Is there a reason why this seems to break the framework? 回答1: Disabled controls shouldn't actually be submitted with the form, so what

playframework, input disabled breaks play from passing the value?

烈酒焚心 提交于 2020-01-13 16:27:04
问题 I have an input field that is filled in from a previous form(so the input is set to disabled on the second page) and we receive null for the value then. This works: <input type="text" class="boxtpl" name="${field.name}" value="${user?.email}"> but this doesn't: <input type="text" class="boxtpl" name="${field.name}" value="${user?.email}" disabled="disabled"> Is there a reason why this seems to break the framework? 回答1: Disabled controls shouldn't actually be submitted with the form, so what

playframework, input disabled breaks play from passing the value?

谁说胖子不能爱 提交于 2020-01-13 16:26:20
问题 I have an input field that is filled in from a previous form(so the input is set to disabled on the second page) and we receive null for the value then. This works: <input type="text" class="boxtpl" name="${field.name}" value="${user?.email}"> but this doesn't: <input type="text" class="boxtpl" name="${field.name}" value="${user?.email}" disabled="disabled"> Is there a reason why this seems to break the framework? 回答1: Disabled controls shouldn't actually be submitted with the form, so what

Using sendmail as SMTP server in Play Framework

偶尔善良 提交于 2020-01-13 14:02:16
问题 I have a Play Framework application that sends emails using SMTP server. Now I have a GMail account handling these emails but I do have sendmail installed and want to use it instead. I have the following configuration in application.conf: mail.smtp.host=smtp.gmail.com mail.smtp.user=myaddress@gmail.com mail.smtp.pass=password mail.smtp.channel=ssl How can I change these lines so that installed sendmail application is used instead? It's working and I can send emails by "sendmail -v acc@dom.com