[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index] [Home]

Re: 1.1 and Adding a new tag to JSP


Paul Siegmann wrote:

>
> I like this approach better.
> but shouldn't that be <gnujsp:encode>...</gjnusjp:encode> or something?

Probably.  I'm confused because the examples they give don't have any "namespace" prefixes, so I'm not sure if that
will be required or not.  I think a set of custom gnujsp tags under gnujsp:* would be great.

> > 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...)
>
> maybe you should send them to the gnujsp-spec-comments address.
> that way we could all benefit from them.

Perhaps if we can come up with a working implementation, we can send a comment on its differences from the spec.

>The current parser fails on <jsp:...> ... </jsp:...> tags.

I spent some time looking at it this morning (being between jobs is great!)  It had a few off-by-one errors, but a
more radical departure occurred to me.  The parser is going to need a bit of a redesign to handle nested/recursive
tags (e.g. scriptlets inside the body of a useBean action).  I played around a bit with a two-phase parser, which
works as follows:

0.  Convert file.jsp into standard XML per Sec. 6.6 of the spec.
1. Pass XML document to XMLParser included in openxml.
2. Walk generated DOM tree to create file.java

The current parser tries to do 0 and 1 at the same time.  I prototyped step 0 with regular expressions (which don't
handle corner cases like quoting) and then passed the results (plus the JSP DTD) to IBM's XML Parser, which was able
to build a nice tree.  I'll try this with openxml next.

If this works then it saves a lot of code and debugging, since the real work of the parser is done for us.

Wes