Create new JBoss Tools Documentation Jira issue

This will launch the Jboss Tools Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.orgCommunity Documentation

Chapter 3. Editors

3.1. Web.xml Editor
3.2. Graphical Editor for Struts Configuration Files
3.2.1. Diagram View
3.2.2. Tree View
3.2.3. Source View
3.3. Graphical Editor for Tiles Files
3.3.1. Create New Tiles File
3.3.2. Tree View
3.3.3. Diagram View
3.3.4. Source
3.4. Graphical Editor for Struts Validation Files

In this chapter we'll introduce you to featured graphical editors for specific Struts files such as Struts Configuration files, Tiles files, Struts Validation files and web.xml.

The web.xml file inside the WEB-INF folder is a deployment descriptor file for a Web Application. It describes the servlets and other components and deployment properties that make up your application.

JBoss Tools add the web.xml file to created Struts project automatically and provides a special editor for its editing. See the Visual Web Tools guide that gives a descriptive information on the web.xml editor.

First, let's dwell on the Struts Configuration file editor.

This editor has three views with different representation of struts-config.xml: Diagram, Tree and Source. The views can be selected via the tabs at the bottom of the editor. Any changes made in one view are immediately visible when you switch to any other view.

Now, we'll consider every view in more detail.

The Tree view represents the different elements of the Struts application that are organized into functional categories on the left-hand side and a form for editing the properties of currently selected items on the right-hand side.


You can right-click on any node in the category tree and perform appropriate operations through a context menu. For instance, by right-clicking on the action-mappings category node, you can add new actions to the application.


Let's consider the tree on the left more closely.

  • Under the data-sources node you can create a Data Source object that will be configured and made available as a servlet context attribute.

  • The form-beans node is meant for creating a set of form bean descriptors for this module. Every created element under this node is a JavaBean that implements the org.apache.struts.action.ActionForm class. Use the Properties editor on the right to adjust properties specific to every created form-bean.

  • The global-exceptions node is intended for registering the handlers for the exceptions that might be thrown by an Action object.

  • Use the global-forwards node to add, edit or delete a global forwards that represent ActionForward objects available to all Action objects as a return value.

  • The controller node allows you to configure the controller properties.

  • Under the resources node you can add, delete, or edit message resources.

  • Under the plug-ins node you can define a Struts plug-in. Right-click the node, select Create Plug-in and specify the plug-ib Id and ClassName by pointing to the Java class which implements the org.apache.struts.action.PlugIn interface.

Here, you'll know how to make use of the special graphical editor for Tiles configuration files.

The editor has three main views: Tree, Diagram and Source. The views can be selected via the tabs at the bottom of the editor. Any changes made in one view are immediately visible when you switch to any other view.

Before we consider each view of the editor, let's look at the way of creating new Tiles files.

Providing full support for development Struts applications JBoss Tools comes with a visual validation editor. To open the editor double-click on the validation file or if you don't have it create a new one.

To create a new validation file, right click any folder in Project Explorer and select File > New > Other... from the context menu and then JBoss Tools Web > Struts > Validation File.


The validation editor works with five modes: Formsets, Validators, Constants and standard Tree and Source that you can easily switch over using tabs at the bottom of the editor.

The Formsets view shows forms and their elements on the left side and the dialogue for defining their validation rules on the right side.


The Constants view let you set constant values for your validation rules.


The validation file can also be viewed in a Tree view.


At any point you have full control over the source by switching to the Source view. Any editing in this view will immediately be available in other views of the editor.


You can also open your own custom or Struts-standard validation-rules.xml file.

The Validators view shows the validation rules for a selected validator. You can of course add your own rules.


Here are the validation rules shown in the Source mode.