ONJava.com    
 Published on ONJava.com (http://www.onjava.com/)
 See this if you're having trouble printing code examples


Eclipse Web Tools

by Lawrence Mandel, Jeffrey Liu
10/05/2005

The release of the Eclipse Web Tools Platform (WTP) Version 0.7 in July 2005 marks a significant milestone in open source web and J2EE development. The WTP project, seeded by contributions from the IBM Rational Application Developer for WebSphere and ObjectWeb Lomboz, provides a set of well-rounded and tightly integrated tools that simplify the creation of often complex web and J2EE applications. These tools also form the foundation of an integrated web and J2EE tools platform that offers great flexibility to vendors who want to add their own extensions and customization.

This article will give you an overview of the WTP project, take you on a tour of the great tools it has to offer, and provide a glimpse into the WTP 1.0 release currently scheduled for December 2005.

The Web Tools Platform Project

The WTP is a new Eclipse top-level project, released for the first time on top of Eclipse 3.1, that contains tools and a platform that support both web and J2EE development. The WTP consists of two subprojects: Web Standard Tools (WST) and J2EE Standard Tools (JST). The WST project contains tools for programming-language-neutral standards such as HTML, XML, and web services. The JST project contains tools specific to the Java language and its J2EE platform such as EJB, servlet and JavaServer Pages (JSP), and Java web services.

The WTP project has three key goals that speak directly to its tools' users and platform extenders.

    Related Reading

    Eclipse IDE Pocket Guide
    By Ed Burnette

  1. Performance. The tools will be "lean and mean": they will minimize memory requirements without sacrificing responsiveness.
  2. Usability. The tools will be easy to learn and require little knowledge of the underlying technologies, facilitating the creation of sophisticated applications by all developers.
  3. Quality. The tools will be of industrial quality and the API will be of platform (read "very high") quality.

The WTP 0.7 release includes tools for:

From a web and J2EE platform perspective, the second part of Goal 3 is a platform-quality API. This goal is targeted for the 1.0 release-- seeFrom WTP 1.0 to 0.7 and Back Again for an explanation. The WTP API will define WTP as a platform and allow independent software vendors (ISVs) to develop their own enhancements to the Eclipse web tools.

When adopting an open source project, ISVs should primarily consider longevity. With companies such as BEA, IBM, and Oracle already committed to the WTP, the platform already has the support it needs to last a long time.

A Tour of the Eclipse Web Tools

The first release of WTP provides a well-integrated and easy-to-use development environment for web and J2EE developers of various levels of experience. It makes the tasks of development, testing, and deployment of web and J2EE applications, which can be rather complex, straightforward for developers not deeply immersed in J2EE specifics. Consider a typical J2EE application that provides both business-to-business (B2B) and business-to-client (B2C) services. Figure 1 illustrates how such applications can be architected.

Overview of a typical J2EE application
Figure 1. Overview of a Typical J2EE Application

For simplicity and scalability, a typical application will use a database management system (DBMS) for data storage. An Enterprise JavaBeans (EJB) component together with a Java database connection (JDBC) driver can be used to access data from the DBMS. To satisfy the B2B requirement, the EJB component can be exposed as a web service to achieve a platform-neutral and highly interoperable integration point. Finally, the presentation layer between the application and clients can be implemented using a combination of HyperText Markup Language (HTML) and JSP technology. Such an application may look complex on the outside, but using the WTP you can develop it quickly and without a great depth of knowledge about all of the technologies mentioned above.

The Data Layer (Model)

The WTP is equipped with vendor-neutral tools that allow developers and administrators to manage their data through the use of JDBC drivers. The currently supported DBMSs include Apache Derby, IBM DB2 Universal Database, IBM Informix, MySQL, Oracle Database, Microsoft SQL Server, and Sybase, but any vendor can contribute to WTP by plugging in its own DBMS adaptor. The WTP provides a connection wizard to create live connections to a DBMS. With a connection established, you can view database elements such as tables, stored procedures, and user-defined functions, and update table content using the Database Server Explorer, shown in Figure 2.

The Database Server Explorer
Figure 2. The Database Server Explorer

In addition to viewing data, you can use the SQL Scrapbook to help you construct SQL commands to execute against a connection. Together these tools allow you to access and manage your data with ease.

The Business Layer (Controller) with J2EE

J2EE itself is complex and can be overwhelming to developers who are new to it. As mentioned above, one of WTP's goals is usability. With respect to J2EE, this means providing tools that enable you to work more efficiently within the J2EE environment, reducing development time and the amount of experience and knowledge needed to create complex applications. The WTP includes wizards that guide you through the creation of various J2EE modules. It also provides great flexibility in how to manage these modules.

One example of the WTP's flexibility is the flexible project layout feature of the J2EE tools. This feature allows you to bundle multiple J2EE modules into the same project rather than being tied to the traditional one-module-per-project mapping. Such a flexible layout enables you to choose a project structure that best fits your style and needs, which can greatly reduce the complexity of managing large applications. Supporting multiple modules per project is just the first achievement of the flexible project layout. Future extensions to this feature will address the folder level, allowing you to further customize your development workspace by specifying your own names and locations for source and class folders. To further simplify your development effort, the J2EE tools can also generate skeleton code for commonly used J2EE artifacts such as servlets and EJB components, and also support de facto industry standards such as XDoclet.

The WTP also contains tools for web services, now an integral part of J2EE. These tools allow you to easily create interoperable web services. Interoperability is the key to the success of web services as it allows you to make the powerful statement that your service can be utilized by any business application running on any platform (be it built on Java or .NET) on any operating system. The XML schema and WSDL editors (shown in Figure 3) allow you to visually design your web services, hiding the complex standards that define a web service description. These editors and the corresponding XML schema, WSDL, and WS-I validators verify that your XML schemas and WSDL documents comply with standards and conform to the WS-I profiles. This ensures that the web services you produce will have the best chance of interoperability.

Thumbnail, click for full-size image.
Figure 3. The WSDL editor (click for full-size image)

Once your WSDL document is complete, the Web Service wizard helps take you from your abstract definition (your WSDL document), through implementation of your Java web service, right to deployment and testing of your completed web service. For the novice web services developer, in just a single click, the Web Service wizard can take you from a WSDL document to a fully deployed web service. More experienced developers can choose to step through this wizard to modify the configuration of their web services, tailoring them for more specific applications by performing actions such as custom namespace to Java package mapping. Using the wizard, you can also pick and choose your combination of server and web service runtime support. The WTP supports the popular Apache Axis web services runtime running on the Apache Tomcat servlet container or the Apache Geronimo J2EE server. The web services framework is also extensible, providing vendors with the hooks they need to easily plug in their own implementations to extend the web service runtime support. In addition to the tools that create web services, the WTP also includes a Web Services Explorer, shown in Figure 4, that supports the publication and discovery of web services to and from UDDI, and unit testing of web services.

The Web Services Explorer
Figure 4. The Web Services Explorer

The Presentation Layer (View)

In addition to J2EE development, the WTP also includes tools to build web-centric applications. The Structured Source Editing (SSE) tools support the editing of XML, DTD, HTML, CSS, JavaScript, and JSP documents. These editors provide the Eclipse "franchise functions" made popular by the Java development tools, such as syntax highlighting, content assist, and source formatting, which anyone who has used the Eclipse Java editor will be very familiar with. The WTP also supports JSP debugging, shown in Figure 5, which allows you to set breakpoints in the JSP editor and debug the JSP component on a unit test server. As should be expected, JSP debugging is integrated into the Eclipse debug framework and works in a similar manner to Java debugging.

Debugging a JSP Component
Figure 5. Debugging a JSP component

Deploying Your Application

The WTP comes with a set of server tools that enable you to work with servers available from other vendors. Included in the WTP is support for Apache Geronimo, Apache Tomcat, IBM WebSphere, BEA WebLogic, JBoss, and JOnAS. By providing the server installation location and a few other parameters (the type and number of which depend on the specific type of server), you can configure, start, stop, publish, and debug an application on a server from within the Eclipse development environment. This significantly improves the unit testing experience and integrates the deployment stage of development into your development environment.

From WTP 1.0 to 0.7 and Back Again

After WTP milestone M3, the WTP project management committee (PMC) determined that the WTP API had not yet had a significant chance to be reviewed or to begin being adopted by ISVs. One of the WTP project's goals is a platform-quality API, which encompasses binary compatibility between releases (which means the code you write to extend the WTP on release X will work without modification on all future WTP releases as well). In order to support binary compatibility, the PMC decided that it would be in the best interests of the WTP, its contributors, and its community not to prematurely declare API. In response to Eclipse convention with respect to the amount and quality of API that is required of a 1.0 release, the PMC decided to change the release number from 1.0 to 0.7. This convention follows from the first Eclipse release way back in 2001, which was numbered 0.9 for the same reason. The PMC decided that the WTP would stay on schedule to release the first version in July 2005, but that the focus of the first WTP release would shift to cover only the industrial-quality end user tools. The follow-up release to 0.7 will be the 1.0 release. The WTP 1.0 release, currently scheduled for December 2005, will focus on the platform-quality API and contain bug fixes to further support the industrial-quality tools.

Summary

This article contains an overview of the WTP project, a tour of its end user tools, and an explanation of its version numbering with a lead-in to the next release. The WTP is a combined effort from many companies and organizations to produce industrial-quality web and J2EE tools for the Eclipse platform and a web and J2EE development platform that can be extended by ISVs. The tools are available in the July 2005, WTP 0.7 release. The platform-quality API will be available in the December 2005, WTP 1.0 release.

You are the WTP community. The only way the WTP will fulfill the community's goals is if you provide feedback through bug reports and newsgroup postings, and provide other contributions such as code, documentation, and promotion, where you can. WTP 0.7 contains industrial-quality end user tools and is a good candidate for independent software vendors to explore as a basis for extension. With the community's help, the WTP will continue to improve, adding new tools and API, and allow Eclipse to lead the way as the open source web and J2EE development environment.

Resources

Jeffrey Liu is a software developer at the IBM Toronto Lab, and a committer for the Eclipse Web Tools Platform (WTP) project.

Lawrence Mandel is a software developer at the IBM Toronto Laboratory, and the lead of ecosystem development and a committer for the Eclipse Web Tools Platform (WTP) project.


Return to ONJava.com.

Copyright © 2009 O'Reilly Media, Inc.