You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Curt Hagenlocher <cu...@motek.com> on 2001/11/07 22:14:23 UTC

RE: DO NOT REPLY [Bug 4708] New: - html:text Input tag should be terminated with />

 
> It is true that the generated HTML is not XML compliant. HTML 
> itself is not XML compliant, which is at least part of why XHTML
> was created.
> 
> It's not clear to me that we can change the output to be 
> XHTML. I suspect that not all browsers - particularly older ones -
> will accept XHTML in place of HTML.

I've heard that it's okay to use XHTML on a lot of older browsers
when constructed with a space before the closing />. For instance,
"<br />" instead of "<br>" or "<br/>".

Regardless of its potential drawbacks, I think Struts should be
able to generate valid XHTML for people who want it.  Maybe there
should be an init-param to ActionServlet that enables XHTML
compatibility.  A static variable (perhaps contained in
org.apache.struts.taglib.html.BaseTag) could be initialized with
either ">", "/>" or " />" as desired, and the contents of this
variable used where appropriate in the various html:tags instead
of an explicit ">".

--
Curt Hagenlocher
curth@motek.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: DO NOT REPLY [Bug 4708] New: - html:text Input tag should be terminated with />

Posted by "Craig R. McClanahan" <cr...@apache.org>.
I do not think we should arbitrarily generate XHTML code from the existing
tags, for backwards compatibility reasons.

It's a bit more work, but my original thought was that we'd create a
struts-xhtml tag library, analogous to struts-html.  With some suitable
refactoring, it should be possible to reuse practically all of the
existing code.

Now, the page designer gets to choose what they want.  Switching from HTML
to XHTML is as simple as changing the <%@ taglib %> directive at the top.
And, the XHTML version of the library might end up with some extra tags as
additional XHTML modules get defined but don't have analogs in HTML 4.0.

Craig


On Wed, 7 Nov 2001, Curt Hagenlocher wrote:

> Date: Wed, 7 Nov 2001 13:14:23 -0800
> From: Curt Hagenlocher <cu...@motek.com>
> Reply-To: Struts Developers List <st...@jakarta.apache.org>
> To: 'Struts Developers List' <st...@jakarta.apache.org>
> Subject: RE: DO NOT REPLY [Bug 4708] New: - html:text Input tag should be
>      terminated with />
>
>
> > It is true that the generated HTML is not XML compliant. HTML
> > itself is not XML compliant, which is at least part of why XHTML
> > was created.
> >
> > It's not clear to me that we can change the output to be
> > XHTML. I suspect that not all browsers - particularly older ones -
> > will accept XHTML in place of HTML.
>
> I've heard that it's okay to use XHTML on a lot of older browsers
> when constructed with a space before the closing />. For instance,
> "<br />" instead of "<br>" or "<br/>".
>
> Regardless of its potential drawbacks, I think Struts should be
> able to generate valid XHTML for people who want it.  Maybe there
> should be an init-param to ActionServlet that enables XHTML
> compatibility.  A static variable (perhaps contained in
> org.apache.struts.taglib.html.BaseTag) could be initialized with
> either ">", "/>" or " />" as desired, and the contents of this
> variable used where appropriate in the various html:tags instead
> of an explicit ">".
>
> --
> Curt Hagenlocher
> curth@motek.com
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>