博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PLAY框架
阅读量:2357 次
发布时间:2019-05-10

本文共 7327 字,大约阅读时间需要 24 分钟。

//

http://www.playframework.com/

http://www.playframework.org/已经被废弃

Play Version:2.3.1

The Play team is pleased to announce the release of Play 2.3.0!

What’s new inPlay2.3


  1. Introducing the activator command. You can useactivator exactly like you would use play, but Activator brings new features too. ()

  2. Better tooling for static assets.Play now uses which gives faster asset processing, more features, and better extensibility.

  3. Support for (and continued support for Java 6 and 7).

  4. BetterJava performance. Simple Java controllers give 40–90% better throughput. (Thanks to for sponsoring licenses.)

  5. Support for (and continued support for Scala 2.10).

  6. Anorm enhancements: SQL string interpolation, multi-value parameters, new types, and more.

  7. Web Services enhancements: separate client, SSL configuration, and more.

  8. Play templates have become : separate project, new sbt plugin, still excellent integration withPlay

  9. Actors for WebSockets

  10. Custom SSLEngine for HTTPS

  11. Asset performance: faster serving, better caching.

  12. One Result to rule them all: all the result types which were deprecated in 2.2 are now gone and only Result remains.

  13. Lots of bug fixes. :)


For details see the and the.

typesafe activator 1.2.3

installing

下载完整的zip文件,而不是min。

 There are three ways to run activator:

 1. Recommended: try `activator ui` to create a project in the UI
 2. Use `activator new` to create a project on the command line
 3. Load an existing project by re-running activator in a project directory

activator ui

[error] p.nettyException - Exception caught in Netty

java.lang.IllegalArgumentException: invalid version format

http://stackoverflow.com/questions/21667254/play-framework-2-2-1-https-fails-on-connection-attempt

keytool -genkey -alias MyKey -keyalg RSA -keysize 2048 -keystore keystore.jksplay -Dhttps.port=9443 -Dhttps.keyStore=keystore.jks -Dhttps.keyStorePassword=password run
上面说使用这个命令就解决了问题。

我试过了

activator new my-first-app play-java
提示说找不到template,因为无法去访问某个地址。
于是设置了~/.activator/activatorconfig.txt
# This are the proxy settings we use for activator-Dhttp.proxyHost=localhost-Dhttp.proxyPort=8580# Here we configure the hosts which should not go through the proxy.  You should include your private network, if applicable.-Dhttp.nonProxyHosts="localhost|127.0.0.1|davidzhang-pc|192.168.0.104" cd my-first-app
activator
$run
出错
org.jboss.netty.channel.ChannelException: Failed to bind to: /0.0.0.0:9000stackflow里面提到了解决方法,不能使用9000端口!
$run 9001

[my-first-app] $ run 9001--- (Running the application from SBT, auto-reloading is enabled) --[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9001(Server started, use Ctrl+D to stop and go back to the console...)

Available Template

E:\Workspaces\play>activator list-templatesFetching the latest list of templates...七月 14, 2014 7:30:58 下午 com.amazonaws.http.HttpClientFactory createHttpClient信息: Configuring Proxy. Proxy Host: localhost Proxy Port: 8xxxFeatured Seed Templates:  minimal-java  minimal-scala  play-java  play-scalaFeatured Tutorial Templates:  hello-akka  hello-scala  hello-slick-2.1  reactive-maps  reactive-stocksOther Seed Templates:  gilt-lib  just-play-java  just-play-scala  play-silhouette-seed  play-silhouette-seed-slick  webjars-sample-play2Other Tutorial Templates:  activator-akka-cassandra  activator-akka-scala-guice  activator-akka-spray  activator-akka-tracing  activator-gilt-app  activator-play-autosource-reactivemongo  activator-scalding  activator-spray-twitter  agile-scala-android-example  akka-callcenter  akka-camel-cxf-weather  akka-circuit-breaker-java  akka-cluster-sharding-scala  akka-clustering  akka-custom-dispatcher  akka-distributed-workers  akka-distributed-workers-java  akka-java-spring  akka-persistence-event-sourcing  akka-sample-camel-java  akka-sample-camel-scala  akka-sample-cluster-java  akka-sample-cluster-scala  akka-sample-fsm-java-lambda  akka-sample-fsm-scala  akka-sample-main-java  akka-sample-main-java-lambda  akka-sample-main-scala  akka-sample-multi-node-scala  akka-sample-persistence-java  akka-sample-persistence-java-lambda  akka-sample-persistence-scala  akka-sample-remote-java  akka-sample-remote-scala  akka-scala-spring  akka-spray-websocket  akka-stream-scala  akka-supervision  akka-supervision-java-lambda  akka-with-esper  angular-seed-play  atomic-scala-examples  config-guice-akka-spray  dart-akka-spray  eventual  finagle-quickstart  hazelcast-spray-akka  hello-akka-java8  hello-apache-spark  hello-play-2_3-scala  hello-play-backbone  hello-play-java  hello-play-scala  hello-sbt  hello-scala-2_11  hello-scala-eclipse  hello-scaladin  hello-scaloid  hello-slick  lolcode-dsl  macroid-akka-pingpong  macwire-activator  matthiasn-sse-chat-template  mirror  modern-web-template  play-2.3-highlights  play-akka-angular-websocket  play-akka-cluster-sample  play-angular-require-seed  play-angularjs-webapp-seed  play-bigpipe-with-rxjava-hystrix  play-cake  play-example-form  play-guice  play-hbase  play-iteratees  play-java-spring  play-mongo-knockout  play-reactive-mongo  play-scala-backbone-todo  play-scalatest-subcut  play-slick  play-slick-advanced  play-slick-bootstrap3  play-slick-quickstart  play-spring-data-jpa  play-sqlite  play-tls-example  play-web-portal  play-websocket  play-yeoman  play2-crud-activator  play2bars-squeryl  PlayStartApp  rabbitmq-akka-stream  reactive-gen-easymda  reactive-java8-play  reactive-maps-java  reactive-orientation  reactive-scales  reactive-stocks-java8  realtime-search  redis-twitter-clone  sbt-github-project-template  sbt-jmh-seed  sbt-native-package-server  scala-phantom-types  scala-testing  scaldi-akka-example  scaldi-play-example  scalikejdbc-activator-template  securesocial-slick-bootstrap3-sample  six-minute-apps  slick-android-example  slick-codegen-customization-example  slick-codegen-example  slick-direct  slick-direct-2.1  slick-multidb  slick-multidb-2.1  slick-plainsql  slick-plainsql-2.1  slick-testkit-example  slick-testkit-example-2.1  snakeyard  spark-in-action  spark-streaming-scala  spark-streaming-scala-akka  spark-workshop  spray-actor-per-request  sse-chat-template-java  tcp-async  template-template  test-patterns-scala  tweetmap-java8  tweetmap-workshop  vaadin-in-akka

$compile

$console

使用IDE调试debug play app:

step1:activator your application with a debug port

activator -jvm-debug 9999 

step2:add a debug configuration in IDE

and in Eclipse right-click on the project and select Debug AsDebug Configurations. In the Debug Configurations dialog, right-click on Remote Java Application and select New. Change Port to 9999 and click Apply. From now on you can click on Debug to connect to the running application. Stopping the debugging session will not stop the server.

step3:run app listending a port

run  9001

step4:add breakpoints in play project app sourcecode

step5:input a url in a browser, test your web app:

http://localhost:9001

///

========================

一位朋友分享的项目

http://my.oschina.net/smeite/blog/184350

https://github.com/smeite/smeite

食美特的项目地址在   已经有好几个月没有更新了,感兴趣的朋友可以去玩玩。整个网站采用playframework2.1+slick+mysql做的架构,有 52个 数据表,前端js使用的是seajs 2.1 和淘宝前端aralejs javascript框架。网站的访问速度和压力都非常不错,做了很多优化,更兴趣的朋友可以去github上看看。 

//

(play1.x)

playframework源代码:
https://github.com/playframework/playframework

-------------------------------------------

这是我要的模板

https://typesafe.com/activator/template/reactive-maps-java

转载地址:http://hajtb.baihongyu.com/

你可能感兴趣的文章
linux查看网卡驱动
查看>>
hadoop运行任务时出现网络链接异常
查看>>
设置MAC OS远程登陆
查看>>
关于java并行程序开发重点
查看>>
hive的优化方式
查看>>
关于hadoop配置hosts文件的问题
查看>>
导入数据出错
查看>>
hive开发环境搭建体验
查看>>
无穷大和NaN
查看>>
Ubuntu下编译安装R全记录
查看>>
Hadoop生态图谱
查看>>
Eclipse下同一个项目如何适应多语言
查看>>
Python performance optimization
查看>>
python的Pattern模块
查看>>
关于hive同一个脚本运行多次而每次结果都不相同
查看>>
File类
查看>>
文件流的输入输出
查看>>
LineNumberReader:记录行号的流
查看>>
Properties,Runtime,SimpleDateFormat,Calendar
查看>>
Math,Random
查看>>