![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Play编程笔记
文章平均质量分 79
杨过悔
这个作者很懒,什么都没留下…
展开
-
1.5_Body parsers
Body parsers What is a body parser? An HTTP PUT or POST request contains a body. This body can use any format, specified in the Content-Typerequest header. In Play, a body parser transforms th转载 2015-03-31 22:25:46 · 468 阅读 · 0 评论 -
JSON with HTTP
JSON with HTTP Play supports HTTP requests and responses with a content type of JSON by using the HTTP API in combination with the JSON library. See HTTP Programming for details on Controlle转载 2015-04-22 23:27:27 · 500 阅读 · 0 评论 -
Integrating with Akka
Integrating with Akka Akka uses the Actor Model to raise the abstraction level and provide a better platform to build correct concurrent and scalable applications. For fault-tolerance it adopts t转载 2015-04-22 22:54:05 · 464 阅读 · 0 评论 -
Application global settings
Application global settings The Global object Defining a Global object in your project allows you to handle global settings for your application. This object must be defined in the default (em转载 2015-04-21 16:16:16 · 500 阅读 · 0 评论 -
filter过滤实例知识
一. 1. builds.scala加上filter的依赖 libraryDependencies ++= Seq( jdbc, anorm, cache, ws, filters ) 2.在App目录下创建 Global.scala import play.api.mvc._ import play.filters.gzip.GzipFilter object原创 2015-04-21 15:39:25 · 784 阅读 · 0 评论 -
filter过滤理论知识
Filters Play provides a simple filter API for applying global filters to each request. Filters vs action composition The filter API is intended for cross cutting concerns that are applied ind转载 2015-04-21 15:38:15 · 599 阅读 · 0 评论 -
Intercepting requests
Intercepting requests Using Filters The filter component allows you to intercept requests coming to the application, transform request and responses. Filters provide a nice ability to implement转载 2015-04-21 16:26:27 · 446 阅读 · 0 评论 -
Accessing an SQL database
Accessing an SQL database Configuring JDBC connection pools Play provides a plug-in for managing JDBC connection pools. You can configure as many databases as you need. To enable the database转载 2015-04-25 22:35:04 · 587 阅读 · 0 评论 -
scala play处理json
看个例子 package controllers import play.api._ import play.api.mvc._ import play.api.libs.json._ import play.api.libs.functional.syntax._ object Application extends Controller { /*1.import play.api.li原创 2015-05-12 17:52:49 · 3032 阅读 · 0 评论 -
SBT使用本地储存
unmanagedBase := baseDirectory.value / "localLib"原创 2015-05-17 09:54:23 · 849 阅读 · 0 评论 -
使用anorm
package controllers import play.api._ import play.api.mvc._ import anorm.SQL import anorm.SqlQuery import play.api.db.DB import play.api.Play.current import play.api.libs.json._ import play.api.libs.原创 2015-05-17 11:57:45 · 768 阅读 · 0 评论 -
Messages and internationalization
Messages and internationalization Specifying languages supported by your application A valid language code is specified by a valid ISO 639-2 language code, optionally followed by a valid ISO 3转载 2015-04-22 22:44:58 · 475 阅读 · 0 评论 -
2.4_WebSockets
WebSockets WebSockets are sockets that can be used from a web browser based on a protocol that allows two way full duplex communication. The client can send messages and the server can receive me转载 2015-04-01 17:10:31 · 564 阅读 · 0 评论 -
2.2_Streaming HTTP responses
Streaming HTTP responses Standard responses and Content-Length header Since HTTP 1.1, to keep a single connection open to serve several HTTP requests and responses, the server must send the appr转载 2015-04-01 14:16:20 · 603 阅读 · 0 评论 -
1.7_Content negotiation
Content negotiation Content negotiation is a mechanism that makes it possible to serve different representation of a same resource (URI). It is useful e.g. for writing Web Services supporting sev转载 2015-03-31 23:02:31 · 453 阅读 · 0 评论 -
1.2_HTTP routing
HTTP routing The built-in HTTP router The router is the component in charge of translating each incoming HTTP request to an Action. An HTTP request is seen as an event by the MVC framework. T转载 2015-03-31 18:14:41 · 525 阅读 · 0 评论 -
3.1_The template engine
The template engine A type safe template engine based on Scala Play comes with Twirl, a powerful Scala-based template engine, whose design was inspired by ASP.NET Razor. Specifically it is:转载 2015-04-02 07:48:37 · 606 阅读 · 0 评论 -
3.2_Scala templates common use cases
Scala templates common use cases Templates, being simple functions, can be composed in any way you want. Below are examples of some common scenarios. Layout Let’s declare a views/main.scala.h转载 2015-04-02 07:57:04 · 544 阅读 · 0 评论 -
1.3_Manipulating Results
Manipulating Results Changing the default Content-Type The result content type is automatically inferred from the Scala value that you specify as the response body. For example: val textResu转载 2015-03-31 18:21:42 · 383 阅读 · 0 评论 -
1.1_Actions, Controllers and Results
Actions, Controllers and Results What is an Action? Most of the requests received by a Play application are handled by an Action. A play.api.mvc.Action is basically a (play.api.mvc.Request转载 2015-03-31 17:46:54 · 486 阅读 · 0 评论 -
1.4_Session and Flash scopes
Session and Flash scopes How it is different in Play If you have to keep data across multiple HTTP requests, you can save them in the Session or Flash scopes. Data stored in the Session are avai转载 2015-03-31 22:03:42 · 509 阅读 · 0 评论 -
1.6_Action composition
Action composition This chapter introduces several ways of defining generic action functionality. Custom action builders We saw previously that there are multiple ways to declare an action转载 2015-03-31 22:54:55 · 581 阅读 · 0 评论 -
2.1_Handling asynchronous results
Handling asynchronous results Make controllers asynchronous Internally, Play Framework is asynchronous from the bottom up. Play handles every request in an asynchronous, non-blocking way. The转载 2015-03-31 23:14:05 · 501 阅读 · 0 评论 -
2.3_Comet sockets
Comet sockets Using chunked responses to create Comet sockets A good use for Chunked responses is to create Comet sockets. A Comet socket is just a chunked text/htmlresponse containing only e转载 2015-04-01 14:36:35 · 378 阅读 · 0 评论 -
The Logging API
The Logging API Using logging in your application can be useful for monitoring, debugging, error tracking, and business intelligence. Play provides an API for logging which is accessed through the转载 2015-05-24 00:40:02 · 409 阅读 · 0 评论