We need to ensure that HTML taglib tags in included JSP pages also heed
the xhtml attribute. That isn't the case with what's there now, because
findAncestorWithClass() will fail for the tags in the included pages.

Note that this is why the form tag stores itself in a request attribute.
Originally, it also used findAncestorWithClass(), but it was changed to
allow forms to span pages.

So I see two ways of handling this:

A) Have the <html:html> tag store itself in a request attribute, and
change BaseHandlerTag.isXhtml() to grab the tag from there before calling
getXhtml().

B) Have the <html:html> tag store the value of its 'xhtml' attribute as a
request attribute, and use that in BaseHandlerTag.isXhtml().

Of these, I prefer the first approach because it makes it harder for
people to futz (technical term :) with the value in their pages.

--
Martin Cooper


On Tue, 12 Nov 2002, David Graham wrote:

> I've updated that html taglib tags to output xhtml when they are nested in a
> <html:html xhtml="true"> tag.  This was very simple to do and resulted in
> minor code changes.  Users have suggested this approach:
>
> 1.  Add Globals.XHTML_KEY which is a boolean request scoped attribute
> 2.  html tags check for that request attribute being true and output
> accordingly.
> 3.  The html:html tag sets this request attribute when it's xhtml attribute
> is true.
>
> The second approach allows the tags to output xhtml without relying on the
> <html:html> tag.  This allows people to construct pages with jsp includes.
> The first approach is logically clearer (to me) and you can use tiles to
> modularly construct the pages like includes.  Approach 2 may be confusing
> because you would have to remember all the places you may have set that
> request attribute.
>
> So, do we go with 1, 2 or both?
>
> David
>
>
>
>
>
> _________________________________________________________________
> STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
> --
> To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org>

Reply via email to