Validating source
You validate source files to determine whether the files contain errors.
About this task
When you work with source files in a structured source
editor, your files are validated in two ways:
Procedure
- Validating files when you edit source
code. Source validation occurs as you type your code before the file is saved or built. For example, if you were to type the following code in a JSP editor:
where exa:mpl is a tag that does not exist, the problem is 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.<exa:mpl>
To turn source validation on or off for all structured source editors:
- Click Window > Preferences > General > Editors > Structured Text Editors.
- Select (or clear) Report problems as you type.
- Validating files during batch processing. Batch validation occurs on saved files. It can identify build process errors and other errors that the source validator cannot identify. For example, in the following JSP code 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.<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
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 menu.
- To set preferences for batch validation, click Window > Preferences > Validation.
Parent topic: Editing source code

