CFML Code Validation

ColdFusion provides two methods of validating your CFML code:

Runtime validation

The ColdFusion Application Server features two modes of attribute checking for processing application pages: strict and relaxed. Macromedia recommends that you always use the strictest possible level of CFML validation.

To enable strict validation:

  1. Open the ColdFusion Administrator Server Settings page.
  2. Select the Enable Strict Attribute Validation check box.

The code validator inspects all code and validates most attributes before execution begins, when the CFML is converted into executable pseudocode. However, tags with a switch attribute, such as action or method, for which the value is provided at runtime, are validated during execution. Validation of such attributes causes a slight performance penalty.

Although dynamically providing an action can save a few lines of code, you should avoid this practice in the interest of a more complete validation and faster application performance.


Tip

If a commercially purchased custom tag fails to run, try turning off the Enforce Strict Attribute Validation setting in the ColdFusion Administrator. If the tag continues to generate errors, you should contact the tag's vendor.


The CFML syntax checker

You can run the CFML syntax checker to validate your pages. It scans your pages and returns a list of pages that do not pass the syntax check, with error messages indicating the cause of each failure. The CFML Syntax checker application page is:

webroot/cfdocs/cfmlsyntaxcheck/cfmlsyntaxcheck.cfm.


Note

The CFML syntax checker cannot detect an invalid attribute combination for attributes whose values are provided at runtime because it does not execute the CFML page it checks.




Banner.Novgorod.Ru