5

I've had a bit of a play with Spring Roo recently and I like the feature that generates CRUD pages automatically for particular objects. In all my years developing JVM-based web applications I've found myself writing and re-writing list, add, remove and edit features in the UI and I'm surprised I've not come across this kind of thing before.

However, I wouldn't want to use Roo on a proper project for a number of reasons, but fundamentally because I think it's silly to generate several megabytes of XML, AspectJ and other "magic" to do something that could easily be expressed in Java!

It has, however, whet my appetite for something that will do this CRUD JSP generation for a given object. This could be annotation-driven at runtime or a code generation tool, I don't really mind as long as it's going to save time. Can anyone recommend such a library?

3
  • If your focus was JavaEE(jsf-facelets) and not Spring-Jsp I would suggest JBoss Forge, but given your requirements only Spring Roo comes to mind :(
    – dimzak
    Jun 4, 2014 at 13:42
  • 1
    Spring isn't a requirement, I'm just looking for a JSP technology. I looked at Forge but it seems to be basically the same thing as Roo with the command-line interface and isn't what I'm looking for. Thanks anyway!
    – ATG
    Jun 26, 2014 at 22:13
  • in netbeans , there is option to create crud pages from database . i done this on nb 8.1 . and for rad, use cuba platform .
    – Esdras
    Feb 19, 2019 at 19:45

1 Answer 1

1

Vaadin

The Vaadin framework (Wikipedia) is a Servlet-based tool for generating the entire GUI of your web app on-the-fly. As a "single-page application", all of your app’s "screens"/views are dynamically loaded into the browser. You write only pure Java to run on the server-side in a Servlet container such as Apache Tomcat or Eclipse Jetty. You write Java code to create a field, a label, a button, and such. Vaadin automatically handles creating the HTML/CSS/JavaScript necessary on the client-side (in the browser) to render those Java-defined widgets of yours.

Vaadin includes its own data model. That data model feeds the Container-based widgets, Table and Grid, for presenting rows-and-columns of data.

Such data can be edited in Layouts where fields are bound to data items. Vaadin offers you the option of letting it generate basic CRUD forms for you, or you can take the reins to create your own custom more-intricate layout.

See this Answer and this Answer of mine in StackOverflow.com for more discussion. The Vaadin.com has a wealth of introductory material, including The Book Of Vaadin.

Counterpoint

If you are married to JSP technology, then ignore this Answer. Vaadin entirely obviates the need for JSPs in a web app.

Similarly, if you want to take full control of the HTML, CSS, and JavaScript in your web app, then ignore this Answer. While you can tweak the HTML, CSS, and JavaScript in a Vaadin app, doing so is not the norm. The central purpose of Vaadin is to mask the details of those web technologies. Normally in a Vaadin app you do 100% (or 99%) of your work in beautiful pure Java.

2
  • This looks interesting and has comprehensive documentation, but unless I'm very much mistaken I would still have to declare all the UI components in Java and bind them to my domain model manually. I was ideally hoping for something a bit cleverer that would infer the UI controls dynamically from the domain model. Thanks for the suggestion, though, it still looks a great framework.
    – ATG
    Jun 19, 2015 at 18:22
  • There's a tutorial here for doing this with Spring Boot, Spring Data and Vaadin. Still requires some code - but the CRUD part is done for you: spring.io/guides/gs/crud-with-vaadin May 24, 2016 at 11:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.