2.2.4. Graphical Editor for Struts Validation Files

Providing full support for development Struts applications JBoss Developer Studio comes with a visual validation editor. 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.

Creating New Validation File

Figure 2.92. Creating New 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 mode shows forms and their elements on the left side and the dialogue for defining their validation rules on the right side.

Formsets Mode

Figure 2.93. Formsets Mode


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

Constansts Mode

Figure 2.94. Constansts Mode


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

Tree Mode

Figure 2.95. Tree Mode


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

Source Mode

Figure 2.96. Source Mode


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

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

Validators Mode

Figure 2.97. Validators Mode


Here are the validation rules shown in the Source mode.

Validation Rules

Figure 2.98. Validation Rules