Is is possible to implement the client side of a Play Framework 2.x web application using GWT or Vaadin?
Play 1.x has a special module that provides GWT integration, but I can not find examples of the use of these technologies together in Play 2.x version. Can these technologies be integrated? Is there a module, or must some other approach be used?
Vaadin is a known framework to GWT developers. Vaadin used GWT to build a full fledged application framework. It is one of the main GWT based frameworks ( along with Errai framework) and provides some interesting capabilities like addons, themes, integrations with other Java frameworks such as Spring.
Play comes with two configurable server backends, which handle the low level work of processing HTTP requests and responses to and from TCP/IP packets. Starting in 2.6. x, the default server backend is the Akka HTTP server backend, based on the Akka-HTTP server. Prior to 2.6.
Play is a high-productivity web application framework for programming languages whose code is compiled and run on the JVM, mainly Java and Scala. It integrates the components and APIs we need for modern web application development.
Play Framework makes it easy to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly architecture. Built on Akka, Play provides predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications.
GWT and Play2 can work together seamlessly, just as GWT can be used with python and go backends.
Using GWT with Play2 has two parts, serving static files and client-server communication.
For the GWT produced static files (js, css, img..) you can just add them to the Play2 public
directory, and they will be accessible based on the routes configuration.
For client-server communication your best bet is using a pure json-rest approach, as request-factory, gwt-rpc have some dependency on J2EE servlets.
There are plenty examples of providing a json/REST api with Play2, and plenty examples of interacting with json/REST APIs with GWT.
Henri Kerola demoed this recently for play 2.x and will give a talk at javaone this year: http://www.youtube.com/watch?v=IwuqAh0VSek
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With