[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
[Home]
1.1 and Adding a new tag to JSP
In JSP 1.1, adding a new tag that would perform HTML encoding should be
trivial, at which point you could do something like:
<encode>Blah blah <%= foo.getBar() %> blah</encode>
IMHO, the tag extension specification is very immature, and it provides
only a glimmer of insight into how these things should actually be
implemented (I have my own ideas, but I don't work for JavaSoft...)
Paul, I think you're wise to aim for 1.0 compliance right now given the
state of the 1.1 spec. Still, I am foolish enough to try to implement
tag extensions as an experimental branch off the experimental branch, if
there's any interest. The basic changes to your excellent reworking of
the parser would be to have it work with a set of
TagLibrary/TagInfo/TagAttributeInfo objects as well as the hardcoded
"jsp:*" tags (though the standard JSP libary could be an
instance/subclass of TagLibrary). I think this can be accomplished
quite cleanly. Based on these parsing instructions, the parser would
create Tag and NodeData items as members of the generated servlet and
reference them when needed in _jspService().
The tough part is actually making a sensible implementation based on the
confused APIs JavaSoft is churning out. I went ahead and coded up
compilable but mostly nonfunctioning classes for everything in
javax.servlet.jsp.tagext, which hopefully I will get improve upon soon.
If anyone wants a snapshot, or wants to append it to classpathx-servlet,
let me know.
Wes