Source and batch validation

There are two types of validation that can occur when you are working with source files in a structured source editor: source validation and batch validation.

Source validation occurs as you type your code; this validation reflects the "unsaved" and "unbuilt" contents of the source you are editing. For example, if you were to type the following code in a JSP editor:

<foo:bar> where foo:baris a tag that does not exist, the problem would be discovered immediately and would appear underlined in the editor. The advantage of this type of validation is that it can alert you to errors instantly.

Note: To turn source validation on (or off) for all structured text editors, click

Window | Preferences | General | Editors | Structured Text Editors and check (or uncheck) Report problems as you type.

Batch validation occurs on saved files. It can catch build process errors and other errors that the source validator cannot. For example, suppose you typed the following in a JSP editor:

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> In this example, the same prefix is used twice. This would prompt the batch validator to trigger markers and to generate build warnings in the Problems view and in the Navigator.

Batch validation can uncover errors in multiple files at once and give you a comprehensive view of where problematic code can be found in your project. Moreover, you do not need to open files in an editor to run batch validation. To run batch validation on specific files, select and right click the files in the Enterprise Explorer and then select

Run Validation from the popup menu.

Note: To set preferences for batch validation, click

Window | Preferences | Validation

 

Related concepts

Structured text editors for markup languages

 

Related tasks

Editing text coded in markup languages - overview

Setting preferences for structured text editors

Setting annotation preferences for markup languages