📜 ⬆️ ⬇️

Excellent Java MVC framework - Play Framework

Good day!

Not so long ago, I needed a tool or framework in order to create a small website, a showcase, in a short time. There were no special requirements. Actually, the showcase itself and the simplest admin panel, with the ability to edit the parameters of published content. The main requirement was speed. It was necessary to do it all in 1-2 days, taking into account the need for layout design.

My throwing in the search for a tool to implement this project stopped when my friend tonyvelichko threw me a link to playframework.org

After watching the demo video, I was seized with a certain skepticism, since usually such “magic” solutions either do not work or work poorly. However, this tool works. And it works well!

An hour later, after becoming acquainted with the framework, I realized that I would not find a better tool for my task.


The framework is designed to start developing as soon as possible and at the same time immediately see an intermediate result.

Inside the framework is an embeded web server and a custom classloader. What does this give us? First of all, launching the project without first setting up tomkat, etc. + recompiling the source code on the fly. That is, they added a new handler, updated the page - it is picked up. Exceptions must be made for precompiled resources: plugins, libraries, and so on. When adding a library, the application must be restarted

The framework already includes essential tools and allows you not to waste time on their initial configuration.

Want DB support? Ok, here you are embeded JPA (Hibernate), based on customization through annotations. Plus a developed super class for beans that allows to reduce the problems with the EntityManager to zero.

Want a log? Ok, write Logger.error (throwable, String). log4j already configured for you.

Want to validate your forms? Please, forms can pick up annotations of the fields of the beans.

Want an admin panel? It’s not a question, the CRUD module is connected in a config file, which provides an interface for editing objects stored in the database, and has great opportunities for customizing the object's attribute views, etc.

Want a security check? We import the security module and describe the login process itself - password checking, etc. Not difficult.

Cute template-engine

The basis of the engine - Groovy.
Many possibilities, the construction of logical conditions, inclusions of other templates, the declaration of variables.
The engine is able to form URLs for ajax requests to a specific controller, there is a tag # {form} which will prescribe the necessary action itself, etc.

The framework is open source and supports third-party plug-ins.

There are already many third-party plug-ins that allow, for example, to integrate with MongoDB, GAE, etc.
A full list of officially published plugins is available at www.playframework.org/modules


There is a run mode in test mode, automatic execution of a series of tests, a convenient testing interface

Short epilogue

This article does not in any way pretend to have a complete review of the framework. It is rather an attempt to catch on, to generate interest in a nice and convenient Java web development tool. And from the growth of the community, the final product will benefit =)

Any clarifications, tips and additions are welcome. Perhaps there are already lovers of this framework?

Let's play!

Source: https://habr.com/ru/post/106744/

All Articles