Validating JSP Syntax
See Also
The Validate action enables you to detect syntax problems in JSP and tag files
before you execute them on a server. Note that the Validate action does not
translate the JSP code into a servlet. Therefore, the Validate action does not
discover syntax errors that occur at translation time or runtime.
To validate JSP syntax:
- In the Filesystems window, right-click the JSP file or tag file and choose Validate
from the contextual menu. The IDE displays the detected errors in the Output window.
- In the Output window, click an error to display the source of the error
in the Source Editor.
|
To validate all the JSP files in a web module,
right-click the WEB-INF node and choose
Validate All Pages from the contextual menu.
|
Troubleshooting
The following list shows some typical validation messages
and possible solutions:
- Invalid expression. Might be caused by an unmatched curly brace ({).
Look for EL syntax highlighting that extends past the EL expression. If the
ending brace is missing, the Source Editor automatically highlights the next
beginning brace as an error. When you select a brace, the Source Editor highlights
the matching brace.
- Missing equal symbol. This error can be caused by a missing quote
mark ("). Look for code that has the same color as the text or text
that has the same color as the code. Look for tag highlighting that extends
past the tag's end delimiter.
- Missing mandatory attribute. Might be caused by a misspelled attribute.
Use the code completion feature to verify the correct spelling.
- Unterminated tag. Can be caused by a missing percent sign (%)
in the directive's closing delimiter. Look for an end delimiter. that is a
different color from the start delimiter.
- Tag must be empty. Check for a missing forward slash (/)
in the tag's closing delimiter.
Forgetting to delimit EL expressions with curly braces ({}) is a common
error that cannot be caught through validation, because the text is valid syntax.
To catch this type of error, look for expressions that are not highlighted with
the color used for EL expressions.
If you see a the following validation output, there might be an internal cache
problem. You might need to reboot the IDE to be able to validate the JSP file.
java.lang.NoClassDefFoundError: javax/servlet/jsp/tagext/SimpleTagSupport
Legal Notices