Playframework(15)Update the Version to 2.3.8 Going with Java

Playframework(15)Update the Version to 2.3.8 Going with Java
 
Download the latest version, unzip that and do what ever I do in the past
If I create one new project based on scala
> activator new easyplay play-scala
 
To run "easyplay" from the command line, "cd easyplay" then:
/Users/carl/work/play/easyplay/activator run

To run the test for "easyplay" from the command line, "cd easyplay" then:
/Users/carl/work/play/easyplay/activator test

To run the Activator UI for "easyplay" from the command line, "cd easyplay" then:
/Users/carl/work/play/easyplay/activator ui
 
Check the Installation
> activator -help
 
try java project
> activator new easyplayjava play-java
 
It seems that there is some changes based on the new version. I will try to read the doc again.
Check Java Version
> java -version
java version "1.8.0_25"
 
> javac -version
javac 1.8.0_25
 
Activator Tool
It provides SBT and many templates.
Check the installation
> activator -help
 
Command to start the activator
> activator ui -Dhttp.address=0.0.0.0 -Dhttp.port=8888
 
Create a new Java Project
> activator new easyplayjava play-java
all the things are based on sbt. I am familiar with that.
 
This command will enter the console
> activator
 
activator, sbt, similar.
 
JAVA8, RESTful Playframework 2.x, Mysql Example  https://github.com/luohuazju/sillycat-playrest
 
Java API and Introduction
http://sillycat.iteye.com/blog/1750340 HTTP, router, cookie, session, flash
http://sillycat.iteye.com/blog/1750947 Promise<Result>, html Template
http://sillycat.iteye.com/blog/1751649 Form- spring data binder, @BodyParser.Of(Json.class)- handler response
 
Asynchronous
avoid blocking operation in controller, such as JDBC calls, steaming API, long computation.
 
Promise for client, another Promise to get the result.
 
promise() helper
Promise.promise(()->intensiveComputation());
Use thread to handle that.
 
Java AKKA
Play contains a default AKKA system.
 
Have AKKA system in controller, convert Future to Promise to return.
 
Deploy Option Configuration
> activator stage
> bin/easyplayjava -Dconfig.file=conf/application.conf -Dhttp.port=8888 -Dhttp.address=0.0.0.0
 
References:
Installation
 
deployment
 
new doc
 
 

猜你喜欢

转载自sillycat.iteye.com/blog/2192224