Most of the changes in the Java world for the last few years revolve around enterprise API’s. Similarly, the changes in JBuilder reflect that as well. JBuilder has turned into a J2EE power house, delivering productivity tools for all aspects of enterprise development. This section looks at the changes in JBuilder’s J2EE support in versions 10 and 11 (JBuilderX and JBuilder 2005), starting with EJB and moving to web development. The newest kid on the block, Java Server Faces, has its own section later.
EJB support gets better in each version, and it goes beyond just adding support for new versions of servers. The designers for EJB components now make the sometimes dauntingly complex EJB development much simpler. The general visual designer allows you to create beans for a particular module (which corresponds to an EJB JAR file), add methods, set attributes, and perform all the necessary tasks all through the designer.
The JBuilder 2005 EJB Designer.
No matter how sophisticated the designer, the ultimate artifact created by the designer is the Java source files and the myriad XML configuration files that accompany them. JBuilder 2005 has improved the deployment descriptor editor for the times that you want to make changes directly in the XML documents.
JBuilder features excellent support for CMP 2.0 entity beans. The designer allows you to create a database connection, then builds the CMP based on the meta-data gathered from the database.
The EJB wizard in JBuilder 2005 allows easy creation of CMP entity beans.
The support for CMP goes beyond just the easy creation of single CMP beans. The EJB specification allows you to create related beans, where a single Collection field in one can point to another entity. The designers in JBuilder 2005 allow you to easily create this relationship as well.
The CMP bean designer allows you to add relationships.
However intelligent the designer is, it cannot determine what the relationship between the tables is without intervention. The designer makes a good guess based on column names and field types. Unfortunately, in this case, it guesses incorrectly for one of the columns. If you click on the new field created for the parent side of the relationship (in this case, Orders), you will see that it has created a link between both order_key (which is correct) and comment (which isn’t).
The relationship designer guess incorrectly about the relationship between tables.
To solve this minor problems, right click on the "orderlineitems" field in the Orders table, clear the relationships, and create the correct one.
Correcting the relationship is easy.
New Deployment Descriptor Editor
All XML configuration files in JBuilder have undergone the same face lift. One of the trends in J2EE development is the heavy reliance on XML. so updating the XML configuration editor in JBuilder touches many areas. When modifying an EJB deployment descriptor by hand, you get both code insight and a property editor for setting values.
The new XML Deployment Descriptor editor features a property editor on the right.
Updated Integration for App Servers
Every version of JBuilder supports the latest application servers, and JBuilder 2005 is no exception. JBuilder now supports the following application servers (and versions):
- Borland Enterprise Server AppServer Edition 5.2 .1
- Borland Enterprise Server AppServer Edition 6.0
- JBoss 3.x+
- Tomcat 4.1
- Tomcat 5.0
- Weblogic Application Server 7.x
- Weblogic Platform Server 8.x
- Websphere Application Server 5.x
- Websphere Application Server Advanced Edition 4.0
- Websphere Application Server Single Server 4.0
- Generic Appserver 1.0
The Generic Appserver appears to handle the case where you need to utilize an unsupported server. For example, it is easy to setup JBuilder to use the JRun servlet engine by filling in the appropriate values in the Generic Appserver setup.
The main distinction between the different server setups lies in the "Custom" tab. Each server has specific settings it requires for paths, parameters, logins, etc. The custom tab allows JBuilder to adhere exactly with the requirements for a particular server.
In versions of JBuilder prior to JBuilderX, integration with the JBoss open-source application server used a custom plug-in. Starting with JBuilderX and extending to JBuilder 2005, JBoss is a first class citizen in JBuilder. The setup for this (and all the other servers) has moved to the Enterprise menu, under Configure Servers.
JBoss is now integrated with JBuilder’s other application servers
Web development has always been a strong suit of JBuilder, and JBuilder 2005 continues in that tradition. Several improvements appear in JBuilder 2005 for building web applications, using standard Java technologies (such as JSP 2.0 and Java Server Faces) and support for open-source frameworks.
Starting with JBuilderX, JBuilder replaced the old web nodes with Web Modules. Web Modules more closely mimic the structure and semantics of a WAR file, which is ultimately what web projects need to build. Operationally, they are similar to the old nodes, but have greater flexibility on placing files and seeing them in the root directory of the web application.
The Module gives you more control over the web root directory.
Better Editor Support
JBuilder 2005 has better support for editing both JSP and the ubiquitous XML documents. You get code insight on XML documents (including Ant build files) and tag-specific code insight on JSP pages. For example, if you have included JSTL in our application, the Code Insight shows you JSTL tags, including information about how to use it.
The JSP editor is tag-aware.
The JSP editor also has a new design surface. As seen above, all the visual design surfaces in JBuilder 2005 have been upgraded to the same consistent look. Depending on the types of tags you have added to the JSP, you get categories on the left of the tags. When you select a tag, you can drop it into the JSP page (a moving highlight shows you where it will drop). Then, you can set the attributes of the tag using the property inspector on the right.
The JSP designer now looks like the Swing designer.
JSP development in JBuilder 2005 has gotten much closer to building desktop applications — you now have a component palette, drag and drop components, and a property inspector.
Syntax Highlight for JSP Expression Language
JBuilder 2005 is completely JSP 2.0 expression language aware. It syntax highlights the JSP expressions and provides editor support for using expression language.
The editor now speaks JSP 2.0 expression language.
The Struts support in JBuilder 2005 makes it very easy to not only create Struts applications but to visualize the flow of information, which is one of the toughest parts of Struts development. JBuilder 2005 allows you to create Struts applications with minimal effort yet allows Struts veterans to build really sophisticated sites.
When you build a new web application with Struts support in JBuilder 2005, you have the option of including both Tiles and the Validation plug-in. JBuilder 2005 includes editors for both of these special purpose XML configuration documents. JBuilder 2005 also includes the Struts 1.1 design editor, which acts as a designer for the underlying struts-config.xml file.
JBuilder 2005 Struts designer makes it easy to modify the struts-config file.
One of the most innovative features of the Struts designer in JBuilder 2005 is the Struts flow designer. Using this designer, you create action classes and visually create the mappings to view resources, form beans, and input pages. When you create an action, the designer shows the action pointing to forward and FormBean placeholders. Clicking on the placeholder allows you to create a new artifact, and the designer allows you to set the relevant properties.
The Action Designer creates visual representations of Struts artifacts.
The design view is even better when you have an ActionForm associated with an action. The designer shows both the incoming and outgoing elements that contribute to the action.
The designer shows a graphical view of the flow of information in the application.
Of course, sometimes it is more convenient to see the details of one of the Struts components in an form view. The form view that has been part of JBuilder since the first support for struts is still here.
The form view shows every possible option for Struts components.
JBuilder 2005 also supports the two standard plug-ins for Struts, tiles and validation. JBuilder 2005 includes a special Tiles editor to help build the tiles.xml document.
The tiles designer eases development using Tiles.