1、 - 1 - 外文原文 JSP.7.4 Validation There are a number of reasons why the structure of a JSP page should conform to some validation rules: Request-time semantics; e.g. a subelement may require the information from some enclosing element at request-time. Authoring-tool support; e.g. a tool may require an
2、ordering in the actions. Methodological constraints; e.g. a development group may want to constrain the way some features are used. Validation can be done either at translation-time or at request-time. In general translation-time validation provides a better user experience, and the JSP 2.0 specific
3、ation provides a very flexible translation-time validation mechanism. JSP.7.4.1 Translation-Time Mechanisms Some translation-time validation is represented in the Tag Library Descriptor. In some cases a TagExtraInfo class needs to be provided to supplement this information. JSP.7.4.1.1 Attribute Inf
4、ormation The Tag Library Descriptor contains the basic syntactic information. In particular, the attributes are described including their name, whether they are optional or mandatory, and whether they accept request-time expressions. Additionally the body-content element can be used to indicate that an action must be empty. All constraints described in the TLD must be enforced. A tag library author can assume that the tag handler instance corresponds to an action that satisfies all cons