Archive for November 16th, 2006

Rapid Seam Development with NetBeans

Thursday, November 16th, 2006

NetBeans is my choice of IDE and JBoss Seam is my choice of application framework. It is a shame that those two do not integrate well. Well, that is, UNTIL NOW! I have just added NetBeans support to Seam Gen — the RoR like command line application skeleton generation tool for Seam (yes, it also generates entity objects from existing DB tables). By answering a few questions on the command line, you can generate a skeleton Seam project with all the necessarily configuration files, source directories, build script, and best of all, IDE integration. The generated Seam project can be opened in both Eclipse and NetBeans, with support for the rapid “edit/save/refresh browser” workflow people seem to crave for … I will cover Seam Gen in detail in the book. But here is what to expect in the NetBeans environment:

Below is what the generated project looks like in NetBeans. The left is the overall structure. You can click on any file to edit — with syntax highlighting, compiler/schema checking, and other NetBeans editor goodies. The right is an expenaded view of the classes in the project.

Picture 11.png

Right click on the project, you can build it and deploy it (Seam Gen already asked for your JBoss AS home when setting up the project). Now, here is the cool part: When the application is running, you can make changes to any file (Java classes, XHTML pages, or configuration files) and click on the “restart” menu. The changed files are automatically pushed to the server and you can simply refresh your browser to see the change. Is niiiice!

Picture 16.png

PS. Sun’s Brian Leonard has a series of blog posts on NetBeans and Seam. His setup is more complex but it does not depend on Seam Gen and provides tighter App Server integration.