jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eduardo Pelegri-Llopart <Eduardo.Pelegrillop...@Sun.COM>
Subject Validators also fit here...
Date Thu, 22 Mar 2001 19:55:07 GMT
THis is mostly an "advertisement"...

I think that TagLibraryValidators also fit in jakarta-taglibs.  The
intention of this JSP 1.2 feature is that a tag library can provide a
methods that will validate some constraints on how the tags are being
used.  Examples can include:

 - No scriptlets used :-)
 - Some tags have to be nested within others
 - SOme tags defining objects have to be defined before some tags that
use those objects
 - Some constraint on the content is mandated

A TagLibraryValidator is invoked on the XML representation of a JSP
page.  If the JSP page was authored in JSP syntax, then template data
"passes through as a blob of text".  If the JSP page was authored in XML
syntax, then one can pass XML fragments that are template.   Using XML
syntax for the JSP page means that extra information is more readily
available, which may be quite useful in some cases like when using JSP
to generate XML that conforms to some schema.

The TagLibraryValidator machinery in JSP 1.2 is invoked through the
TLD.  The TLD can include a reference to a validator and can provide
some data that is passed to it.  When validating a page, the (possibly
none) TagLibraryValidator for each  taglibrary used in the page is
invoked, sequentially.

The intention is that a few TagLibraryValidator classes can be reused in
many tag libraries by passing as an argument a reference to a
description of what to test.  For eaxmple, one can write a TReX
validator that is passed a TReX description.  Or an XML Schema
validator.  Or Relax.  Etc.

I believe that the charter for jakarta-taglibs's includes

It would be great if we had TagLibraryValidator classes that we could
all start using in our JSP 1.2 tag libraries. On the specification side,
I would really like to get some real-life experience with this before
the JSP 1.2 specification goes totally final, so if there is some really
bad bug we can fix it.


	- eduard/o

View raw message