📜 ⬆️ ⬇️

GWT app in 30 minutes

Just recently, a new (still unstable) version of Spring-Roo, one of the main features of which is the support for generating a user interface on GWT, was released.

I found it interesting, today I experimented, under the cut, the translation of my blog (for those who are too lazy to read in English) with a description of how to make the GWT app in less than 30 minutes. I hope this will seem interesting and useful for the Habrovites.
image

What are we talking about


Spring-Framework is one of the most popular frameworks for Java. I think almost everyone who wrote a web application in Java came across it;
Spring-Roo is a utility for quickly generating a project: entity classes for working with the database, typical CRUD, a number of other typical tasks. I understand that the idea grows from Ruby-On-Rail - but I could be wrong
GWT is a library for creating modern web applications with active use of ajax. Developed by Google and more and more popular

First we need JDK 1.6 (what a surprise!) And Apache Maven . I hope in people interested in GWT and Spring these products are installed immediately after installing the operating system.
')
Downloading the latest version of Spring-Roo 1.1M1 from the Spring Source website

Downloading the roo: clinic.roo script is almost the same clinic.roo as in the examples, but only adapted for using GWT:
* The enums are commented out - they are apparently not supported yet;
* Boolean field changed from primitive to java.lang.Boolean (also resulted in a compilation error - apparently not yet supported)
* One-to-many link (in the form of the Set collection) - commented out - not supported yet while generating GWT
* Calendar replaced by Date;
* Commented code generating user interface on Spring-MVC
* And interface generation on GWT is enabled (gwt setup command)

Run this script:
# roo
roo> script --file clinic.roo
roo> exit

We are waiting for some time while roo generates the project source codes for us. As a result, we have almost a standard project using maven for assembly.

Run it:

# mvn gwt:run


There will have to wait some time, because during the assembly all the necessary libraries will be downloaded (and there are quite a lot of them). Re-assembly will take place much faster.
image

Copy the proposed URL and open it in the browser
image

Your GWT app is ready!

findings


Spring-Roo is a good idea, but its integration with GWT is still damp — many things don't work.
But to use it for (for example) learning and a quick start - it is quite possible - in which he will help you, I hope

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


All Articles