Package sunlabs.brazil.sunlabs
Class IdUniquificationTemplate
java.lang.Object
sunlabs.brazil.template.Template
sunlabs.brazil.sunlabs.IdUniquificationTemplate
- All Implemented Interfaces:
TemplateInterface
Template to assign div and span id's that are unique for each
browser window. Html Tag id's are supposed to be unique. However, if there
are multiple browser windows, the server often ends of generating the same
id for each window that is displaying the same url. This template fixes this
by automatically incorporating a unique identifier into every "id"
attribute based on the value of the "subst" request property. The first
"%" character in the value of "subst" is replaced by the specified "id" value.
This template looks at all "span", "div", and "section" tags and rewrites all id attributes. ("section" is a non-standard tag that may be used by the server for automatic "id" uniquification.)
It is up to the developer to make sure there is a request property that is unique for each window that is part us the "subst" value (e.g.
subst=%_${window_id}to append the window id onto the id).
If the boolean attribute "norewrite" is specified, the id will not be rewritten.
If the request property "title.
NOTE:
This template may be useful primarily in debugging multi browser
window AJAC applications, and shouldn't be needed in "production".
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
init
(RewriteContext hr) Called before this template processes any tags.void
void
void
void
-
Constructor Details
-
IdUniquificationTemplate
public IdUniquificationTemplate()
-
-
Method Details
-
init
Description copied from class:Template
Called before this template processes any tags.- Specified by:
init
in interfaceTemplateInterface
- Overrides:
init
in classTemplate
-
tag_span
-
tag_div
-
tag_table
-
tag_section
-