RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Eclipse Callisto Project Profile: Web Tools Platform : Page 2

The Web Tools Platform (WTP) is a powerful set of Eclipse add-ons that make Web application development with Eclipse easier and faster. Take a look under the hood and see how it can help you.


Editing Non-Java Files

Until recently, the standard version of Eclipse was sadly lacking in any sophisticated editing ability for non-Java files. Nevertheless, as any Web application developer knows, there is much more to a Java Web application than just Java: HTML, JSP/JSTL, XML, JavaScript, CSS—the list abounds. Certainly, some available third-party plug-ins provide editors for some of these file formats, some of which are excellent. But this is a functionality that any self-respecting modern IDE really should provide out of the box. And now, with WTP, these invaluable timesaving features are integrated directly into Eclipse.

WTP comes with first-class editors for all of the main file types you'll come across in your Java Web application projects, including HTML, JSP, JSTL, XML, DTD, XML Schema, XSL, WSDL, JavaScript, CSS, and more. WTP 1.5, the version delivered with Eclipse 3.2, also provides some initial support for JSF JSP files, with more complete support promised for future versions. In the current version, JSF support is limited to syntax checking and code completion, like that found for JSTL tags.

Each editor provides syntax coloring and code-completion, as well as a convenient tree-view of the document structure in the Outline view (see Figure 2). The majority of these editors, such as the HTML, JSP, JSTL, JSF, and the other XML-family editors, will raise warnings and/or errors if your file is badly structured or incorrect. All of these features contribute to increasing productivity and improving the user experience when developing with these kinds of files.

Click to enlarge

Figure 2. Editing a JSP/JSTL File with a WTP Editor

Client-side HTML files such as JavaScript and CSS are also accommodated (see Figure 3). These editors provide syntax coloring and a nice structured outline, though the error-detection and JavaScript code-completion features are somewhat limited.

Click to enlarge

Figure 3. Editing a CSS Stylesheet with a WTP Editor

Working with XML

Rare is the J2EE developer who does not need to tinker with XML from time to time. Until now, plug-ins such as XML-Buddy were required for syntax coloring and document validation features.

To remedy this, the WTP project has provided a comprehensive set of editors for XML and XML-related documents. The standard XML editor provides a convenient three-fold view of the XML document (see Figure 4).

Click to enlarge

Figure 4. Editing an XML File Using WTP

The XML source code is displayed and edited in the central panel, which also supports the indispensable syntax coloring and checks that the document is well formed (the XML syntax is correct) and valid (the document structure respects the XML schema or DTD for this document type). The Outline view displays the structure of the document in a tree view. At the bottom of the screen, the Properties panel lists—and lets you edit—the attributes for a selected XML element. This last feature is handy if you don't remember all of the possible attributes for elements in complex XML documents, such as Spring configuration files or Hibernate mappings.

WTP also provides good support for XML schema documents, allowing you to view and edit an XML schema in both textual and graphical form (see Figure 5).

Click to enlarge

Figure 5. Editing an XML Schema Using WTP

The Properties view lets you see at a glance and modify element types and cardinalities. And, as usual, the Outline view gives you a good summary of the document structure. Although you still need a good knowledge of XSD to create new schema effectively, the WTP graphical editor does make working with this sort of file easier and more productive.

Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date