A TagLib enhanced (X)HTML document needs to loads the so called TagLibProcessor, as an external JavaScript file. The processor then looks for TagLibs registered in the <head> section of the document. After loading the TagLibs, the DOM is traversed finding and processing all custom tags – which should be XML namespaced.
A custom tag brings with it a convenient manner to create UI components in a JavaScript class, by either direct and eased DOM modification or even easier (X)HTML generation. Also you can bind variables to custom tag attributes that may refer to JavaScript variables, objects and functions, which are resolved into their real values behind on demand. Also every tag can be independently refreshed, either on a timed basis or in reaction to events, always serving you the current variable situation. This is the base for great flicker free user experiences.
<html> <head> <script type="text/javascript" src="cstl.js"></script> <cstl:taglib classPath="com.inspirationlabs.taglib.std.StdTagLib" ns="std"/> <script type="text/javascript"> function date() { return new Date(); } </script> </head> <body> <std:print var="${date}" refreshRate="1000"> N/A </std:print> </body> </html>
full article download files
0 comments:
Post a Comment