Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to integrate GWT or Vaadin with Play Framework 2.0

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?

like image 529
Dmitry Avatar asked Oct 16 '12 07:10

Dmitry


People also ask

Does vaadin use GWT?

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.

Is Play framework backend?

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.

What is play framework used for?

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.

What is play framework in Scala?

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.


2 Answers

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.

like image 131
Nick Siderakis Avatar answered Oct 12 '22 00:10

Nick Siderakis


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

like image 43
Dominik Dorn Avatar answered Oct 12 '22 01:10

Dominik Dorn