Consider Adopting the JSTL Conventions
The JSTL specification defines a number of conventions you should consider following for your own custom tag library to make it easier for a page author familiar with JSTL to use your library. The following JSTL conventions are generic enough to apply to any tag library:
Expose data created by an action only through scoped variables (i.e., as attributes of the page context, request, session, or application), never as scripting variables. When a scripting element needs access to the data (which should be rare), the standard
<jsp:useBean>action can be used to create a scripting variable and assign it a reference to the scoped variable.Provide attributes named
varandscope(unless the data has “nested visibility”—see next rule) that the page author can use to define the name and scope for the exposed data. If more than one variable is exposed, use thevarandscopeattributes for the most commonly used variable and provide additional attributes starting withvarandscope—e.g.,varDomandscopeDom—for the others.If the exposed data has “nested visibility”—i.e., it’s available only within the action element’s body—the
scopeattribute should not be provided. Instead, the variable should be placed in the page scope before the body is evaluated and removed at the end of the action processing.All attributes except
varandscopeshould accept a dynamic value (a Java or EL expression evaluated at runtime). This provides maximum flexibility, ...