Play! Framework

Facebook Twitter

Introducing the Play Framework. YAML. Snakeyaml. This documentation is very brief and incomplete.

snakeyaml

Feel free to fix or improve it. Installation If you use Maven just add a dependency as described here. If you do not use Maven download the latest JAR and put it to the classpath. Frequently Asked Questions Dictionaries without nested collections are not dumped correctly Why does. Play Framework - Better JSON serialization with FlexJSON. We want to be able to create multiple different JSON views on the same object, to be used in our Play templates.

Play Framework - Better JSON serialization with FlexJSON

This is useful, because entities are often used in several contexts. A news item may be shown with only a few details in a listing of news items, with more details on a separate page for that news item, and with even more details for an editor of the website. Declarative model class enhancement in Play. Textile. Play! Framework cheat sheet. Controller/link?

Play! Framework cheat sheet

I=32&n=patrickpublic static void link(int i, String n)public static void link(Integer i, String n)public static void link(Long i, String n) Controller/show? Id[0]=1&id[1]=2&id[2]=3&id[3]=4public static void show(Long[] id)public static void show(List Controller/get? Date=02-18-1972public static void get(@As("MM-dd-yyyy") Date date) (@As(binder=MyCustomStringBinder.class))Custom parameter binder Send File as multipart/form-data encoded post requestpublic static void create(String comment, File attachment) ? @NoBindingMarks a non bindable field @OnApplicationStart@On("0 0 12 ∗ ∗ ?

") Play framework - Setting up a basic administration area using CRUD. Currently, we have no way to create new blog posts or moderate comments using the blog UI.

Play framework - Setting up a basic administration area using CRUD

Play provides an out of the box CRUD module that will help quickly generate a basic administration area. Enabling the CRUD module A Play application can be assembled from several application modules. This lets you reuse components across several applications or split a large application into several smaller ones. The CRUD module is a generic application that introspects the model classes to create simple lists and forms. Overview (Hibernate JavaDocs) Closure (Groovy 1.7.5) Google Group. Caching. To create high-performance systems, sometimes you need to cache data.

Caching

Ehcache API. Spymemcached - java memcached interface. A simple, asynchronous, single-threaded memcached client written in java.

spymemcached - java memcached interface

Efficient storage of objects. General serializable objects are stored in their serialized form and optionally compressed if they meet criteria. Certain native objects are stored as tightly as possible (for example, a Date object generally consumes six bytes, and a Long can be anywhere from zero to eight bytes). Resilient to server and network outages. In many cases, a client operation can be replayed against a server if it goes away and comes back. Javadocs for spymemcached 2.4.2. Memcached. Module basics. UnboundID LDAP API. Using UnboundID LDAP SDK. LDAP SDK for Java Using the UnboundID LDAP SDK Persistence Framework The UnboundID LDAP SDK for Java provides a persistence framework that can be used to easily store Java objects in an LDAP directory server.

Using UnboundID LDAP SDK

It uses Java annotations to indicate the way that the information should be stored in the directory, and includes support for add, delete, modify, and search operations. It also provides tools that can be used to generate Java source code from LDAP schema, or to generate LDAP schema from properly-annotated source code. The entries generated by the LDAP SDK persistence framework are constructed in a user-friendly form that is suitable for use by virtually any kind of LDAP client. The following pages provide information about the LDAP SDK persistence framework: Featured Downloads.

LDAP Connection Pools with StartTLS. Com.unboundid.ldap.sdk Class StartTLSPostConnectProcessor java.lang.Object com.unboundid.ldap.sdk.StartTLSPostConnectProcessor All Implemented Interfaces:

LDAP Connection Pools with StartTLS

Javassist API. Javassist Tutorial. Getting Started with Javassist Shigeru Chiba.

Javassist Tutorial

YAML Quickstart. YAML Reference. Logging configuration. The Play logger is built on Log4j.

Logging configuration

Since most Java libraries use Log4j or a wrapper able to use Log4j as a backend, you can easily configure logging that is well-suited to your application. Logging from your application Play provides a default logger with the class play.Logger. This class uses Log4j to write messages and exceptions to a logger named “play”. Logging from your application is easy: Log4j 1.2.16 API. Java extensions. Java extensions add convenience methods to objects for use in view templates, making expressions more expressive. The code examples show an example template expression, with its result on the next line.

Collection extensions join(separator) Concatenates the collection’s entries, with the given separator between each entry. Java 6 API. Deployment. Play applications can be deployed virtually anywhere: inside Servlet containers, as standalone servers, in Google Application Engine, Stack, a Cloud, etc... Standalone Play applications The simplest and the more robust way is to simply run your Play application without any container. You can use a frontal HTTP server like Lighttpd or Apache if you need more advanced HTTP features like virtual hosting. The built-in HTTP server can serve thousands of HTTP requests per second so it will never be the performance bottleneck.

Moreover it uses a more efficient threading model (where a Servlet container uses 1 thread per request). Those servers support long polling and allow to manage very long requests (waiting for a long task to complete), and direct streaming of File objects (and any InputStream if you specify the Content-Length), without blocking the execution thread. GlassFish. Google App Engine. Gae module. Moving to production. Testing. Selenium Documentation. ReST. Representational State Transfer (REST) is a software architecture style consisting of guidelines and best practices for creating scalable web services.[1][2] REST is a coordinated set of constraints applied to the design of components in a distributed hypermedia system that can lead to a more performant and maintainable architecture.[3] REST has gained widespread acceptance across the Web[citation needed] as a simpler alternative to SOAP and WSDL-based Web services.

RESTful systems typically, but not always, communicate over the Hypertext Transfer Protocol with the same HTTP verbs (GET, POST, PUT, DELETE, etc.) used by web browsers to retrieve web pages and send data to remote servers.[3] The REST architectural style was developed by W3C Technical Architecture Group (TAG) in parallel with HTTP 1.1, based on the existing design of HTTP 1.0.[4] The World Wide Web represents the largest implementation of a system conforming to the REST architectural style.

How Comet works in Play! Comet. Models. JPA Annotations. Template syntax. Play has an efficient templating system which allows to dynamically generate HTML, XML, JSON or any text-based formatted document. The template engine uses Groovy as an expression language. Template tags. These are the built-in tags that are available in addition to the core template engine syntax. Implicit Objects in templates.

Play has an efficient templating system which allows to dynamically generate HTML, XML, JSON or any text-based formatted document. Controllers. Business logic is managed in the domain model layer. Implicit Objects in Controllers. RenderJson. Gson User Guide. GSON API. Play! API. Getting Started. Dev Roadmap. Submitting Patches. Coding style guide. Learning Scala. Scala module documentation. Getting Started Guide. OVal 1.61 API. OVal - Object Validation. jQuery API. JavaScript Micro-Templating. jQuery UI.