You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Simon Lessard <si...@gmail.com> on 2007/04/20 16:54:31 UTC

MyFaces and HTML 4.01

Hello everyone,

This thread is a follow-up for user@myface.apache.org thread about
HTML 4.01compliance. As mentioned in that thread, JSF spec requires
implementor to
provide a HTML 4.01 compliant renderkit (Section 8.5). However, both JSF RI
and MyFaces cannot currently ensure that. One of the reason is the prefix
used for generated ids. Currently UIViewRoot.UNIQUE_PREFIX_ID = "_id".
However, W3C does not allow ids starting with an underscore (see
http://www.w3.org/TR/html401/struct/global.html#h-7.5.2 and
http://www.w3.org/TR/html401/types.html#type-name).

Therefore, I think the value of UNIQUE_PREFIX_ID should be changed to
something like "mf_id" in order to comply with the spec, even if RI does
not.


Regards,

~Simon


Original thread can be found at
http://mail-archives.apache.org/mod_mbox/myfaces-users/200704.mbox/browser,
thread named XHTML Strict

Re: MyFaces and HTML 4.01

Posted by Simon Lessard <si...@gmail.com>.
Also, this issue is important for some clients, especially governments since
they sometimes have politics about W3C standard compliance. Therefore, a
very small issue like the generated id can be enough to put an end to a
proposed JSF solution on its own. Of course, I know this is not the only
thing needed to get full HTML 4.01, but it would be a good start.


Regards,

~ Simon

On 4/20/07, Mike Kienenberger <mk...@gmail.com> wrote:
>
> I did a quick search, and this issue has come up at least twice
> before, but the responses to keeping the current behavior were
> unconvincing.
>
> 5/20/2005  Serious problems with MyFaces ID allocation which is not
> conform to XHTML!
> 7/12/2006  w3c Markup validator does not like generated ID's after
> MyFaces version 1.1.1
>
> There's nothing in the spec that says we must use underscore (_) for a
> clientID prefix.   In fact, the spec (and javadocs) are pretty clear
> that we can provide any prefix we like so long as it is "unique".
> It's also recommended that it be short :-)
>
> Now a server-side id limited to [A-Z_-].  What are the limitations of
> a client-side id for xhtml and html?   Maybe there's another character
> we can use that's not allowed in a server-side id.  I know that colon
> is also allowed client-side.  Either that or we pick something and
> hope users won't use the same prefix, like mc_, mf_, mm_, zz, or qq_.
>
> Finally, I proposed on the other thread that we allow the web.xml file
> to define the unique prefix.  Unfortunately, I noticed now that the
> value has been declared final.  It might still be possible to allow
> the user to configure it at startup, but that will probably make it
> more difficult.
>
>
> On 4/20/07, Simon Lessard <si...@gmail.com> wrote:
> > Hello everyone,
> >
> > This thread is a follow-up for user@myface.apache.org thread about HTML
> 4.01
> > compliance. As mentioned in that thread, JSF spec requires implementor
> to
> > provide a HTML 4.01 compliant renderkit (Section 8.5). However, both JSF
> RI
> > and MyFaces cannot currently ensure that. One of the reason is the
> prefix
> > used for generated ids. Currently UIViewRoot.UNIQUE_PREFIX_ID = "_id".
> > However, W3C does not allow ids starting with an underscore (see
> > http://www.w3.org/TR/html401/struct/global.html#h-7.5.2 and
> > http://www.w3.org/TR/html401/types.html#type-name ).
> >
> > Therefore, I think the value of UNIQUE_PREFIX_ID should be changed to
> > something like "mf_id" in order to comply with the spec, even if RI does
> > not.
> >
> >
> > Regards,
> >
> > ~Simon
> >
> >
> > Original thread can be found at
> >
> http://mail-archives.apache.org/mod_mbox/myfaces-users/200704.mbox/browser
> ,
> > thread named XHTML Strict
> >
>

Re: MyFaces and HTML 4.01

Posted by Paul Spencer <pa...@apache.org>.
For sites that implement testing, like Selenium, and use the generated Ids their should
be an option to maintain the current prefix.  This option need not be the default, but
it must be documented

Paul Spencer

Mike Kienenberger wrote:
> @ client id values:
> 
> I would also be against using a client id more than a few characters.
> Too much of a performance hit.
> 
> 
> @ configuring:
> 
> static is easy.  If it were just public static, then in the config parser,
> 
>     UIViewRoot.UNIQUE_ID_PREFIX  = new_prefix;
> 
> A system property isn't a bad idea.   It's better than nothing.
> 
> On 4/20/07, Mario Ivankovits <ma...@ops.co.at> wrote:
>> Hi!
>>
>> Belen, Marco wrote:
>> > In order 'choose' an unique prefix, why not re-use a common way to
>> > create unique names in Java: Use a package-structure.
>> > There for until it can be configured in the web.xml how about using
>> > "org_apache_myfaces_" as the clientID-prefix.
>> >
>> My first reaction on this was: "No, please don't" as this will greatly
>> increase the size of the rendered html page if you have tables or trees
>> on it.
>> On the other hand, if one would like to have short ids its simple to
>> configure the id on the component level instead of using the
>> autogenerated one - and IMHO its better to use manual component ids then
>> the automatic created one as this makes the rendered page more readable
>> (in case you have to look at the html source)
>>
>> So I'll have not problem to use this "big" clientId, just, maybe a
>> "o_a_m_id" would make it too.
>>
>>
>> Mike Kienenberger wrote:
>> > Finally, I proposed on the other thread that we allow the web.xml file
>> > to define the unique prefix.  Unfortunately, I noticed now that the
>> > value has been declared final.
>> Yep, not only final - more problematic it is static. What might be
>> possible is to use system properties - at least a way to configure it 
>> then.
>>
>> Ciao,
>> Mario
>>
>>
> 


Re: MyFaces and HTML 4.01

Posted by Mike Kienenberger <mk...@gmail.com>.
@ client id values:

I would also be against using a client id more than a few characters.
 Too much of a performance hit.


@ configuring:

static is easy.  If it were just public static, then in the config parser,

     UIViewRoot.UNIQUE_ID_PREFIX  = new_prefix;

A system property isn't a bad idea.   It's better than nothing.

On 4/20/07, Mario Ivankovits <ma...@ops.co.at> wrote:
> Hi!
>
> Belen, Marco wrote:
> > In order 'choose' an unique prefix, why not re-use a common way to
> > create unique names in Java: Use a package-structure.
> > There for until it can be configured in the web.xml how about using
> > "org_apache_myfaces_" as the clientID-prefix.
> >
> My first reaction on this was: "No, please don't" as this will greatly
> increase the size of the rendered html page if you have tables or trees
> on it.
> On the other hand, if one would like to have short ids its simple to
> configure the id on the component level instead of using the
> autogenerated one - and IMHO its better to use manual component ids then
> the automatic created one as this makes the rendered page more readable
> (in case you have to look at the html source)
>
> So I'll have not problem to use this "big" clientId, just, maybe a
> "o_a_m_id" would make it too.
>
>
> Mike Kienenberger wrote:
> > Finally, I proposed on the other thread that we allow the web.xml file
> > to define the unique prefix.  Unfortunately, I noticed now that the
> > value has been declared final.
> Yep, not only final - more problematic it is static. What might be
> possible is to use system properties - at least a way to configure it then.
>
> Ciao,
> Mario
>
>

Re: MyFaces and HTML 4.01

Posted by Mike Kienenberger <mk...@gmail.com>.
Well, if it's wrong, it still might be worth fixing since JSF 1.2
won't be an option in many environments for quite some time.  But
since you're the one interested in fixing it, if you don't pursue it,
it won't be changed.   In my own use cases, I'm not concerned about
strict html or xhtml compliance.

On 4/23/07, Simon Lessard <si...@gmail.com> wrote:
> Hello all again,
>
> As reading 1.2 spec, I found out that leading underscore was made explicitly
> forbidden (section 3.1.1). Since 1.2 might get to the trunk soon, I guess
> this issue deserves a no-op for 1.1 branch?
>
>
> Regards,
>
> ~ Simon
>
>
> On 4/20/07, Volker Weber <v....@inexso.de> wrote:
> > Hi,
> >
> > >  Maybe i_d?
> >
> > this was also my first thought.
> >
> > Regards,
> >     Volker
> >
>
>

Re: MyFaces and HTML 4.01

Posted by Simon Lessard <si...@gmail.com>.
Hello all again,

As reading 1.2 spec, I found out that leading underscore was made explicitly
forbidden (section 3.1.1). Since 1.2 might get to the trunk soon, I guess
this issue deserves a no-op for 1.1 branch?


Regards,

~ Simon

On 4/20/07, Volker Weber <v....@inexso.de> wrote:
>
> Hi,
>
> >  Maybe i_d?
>
> this was also my first thought.
>
> Regards,
>     Volker
>

Re: MyFaces and HTML 4.01

Posted by Volker Weber <v....@inexso.de>.
Hi,

>  Maybe i_d?

this was also my first thought.

Regards,
    Volker

Re: MyFaces and HTML 4.01

Posted by Simon Lessard <si...@gmail.com>.
Hmmm what about a prefix of the same length than currently to prevent page
size increase, but a bit strange to prevent most potential clashes? Maybe
i_d?

On 4/20/07, Paul McMahan <pa...@gmail.com> wrote:
>
> On Apr 20, 2007, at 12:24 PM, Mario Ivankovits wrote:
>
> Belen, Marco wrote:
>
> In order 'choose' an unique prefix, why not re-use a common way to
>
> create unique names in Java: Use a package-structure.
>
> There for until it can be configured in the web.xml how about using
>
> "org_apache_myfaces_" as the clientID-prefix.
>
>
> My first reaction on this was: "No, please don't" as this will greatly
>
> increase the size of the rendered html page if you have tables or trees
>
> on it.
>
> On the other hand, if one would like to have short ids its simple to
>
> configure the id on the component level instead of using the
>
> autogenerated one - and IMHO its better to use manual component ids then
>
> the automatic created one as this makes the rendered page more readable
>
> (in case you have to look at the html source)
>
>
> So I'll have not problem to use this "big" clientId, just, maybe a
>
> "o_a_m_id" would make it too.
>
>
> I had the same reaction about how this change could increase the size of
> the rendered page.  True that it could be configured at the component level,
> but for the sake of performance how about taking a position that the
> autogenerated one is as small as reasonably possible and rely on the user to
> replace it in the case of a collision?  i.e. the user optionally
> lengthens, not shortens, the autogenerated id.
>
> Best wishes,
> Paul
>

Re: MyFaces and HTML 4.01

Posted by Paul McMahan <pa...@gmail.com>.
On Apr 20, 2007, at 12:24 PM, Mario Ivankovits wrote:

> Belen, Marco wrote:
>> In order 'choose' an unique prefix, why not re-use a common way to
>> create unique names in Java: Use a package-structure.
>> There for until it can be configured in the web.xml how about using
>> "org_apache_myfaces_" as the clientID-prefix.
>>
> My first reaction on this was: "No, please don't" as this will greatly
> increase the size of the rendered html page if you have tables or  
> trees
> on it.
> On the other hand, if one would like to have short ids its simple to
> configure the id on the component level instead of using the
> autogenerated one - and IMHO its better to use manual component ids  
> then
> the automatic created one as this makes the rendered page more  
> readable
> (in case you have to look at the html source)
>
> So I'll have not problem to use this "big" clientId, just, maybe a
> "o_a_m_id" would make it too.

I had the same reaction about how this change could increase the size  
of the rendered page.  True that it could be configured at the  
component level, but for the sake of performance how about taking a  
position that the autogenerated one is as small as reasonably  
possible and rely on the user to replace it in the case of a  
collision?  i.e. the user optionally lengthens, not shortens, the  
autogenerated id.

Best wishes,
Paul

Re: MyFaces and HTML 4.01

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi!

Belen, Marco wrote:
> In order 'choose' an unique prefix, why not re-use a common way to
> create unique names in Java: Use a package-structure.
> There for until it can be configured in the web.xml how about using
> "org_apache_myfaces_" as the clientID-prefix.
>   
My first reaction on this was: "No, please don't" as this will greatly
increase the size of the rendered html page if you have tables or trees
on it.
On the other hand, if one would like to have short ids its simple to
configure the id on the component level instead of using the
autogenerated one - and IMHO its better to use manual component ids then
the automatic created one as this makes the rendered page more readable
(in case you have to look at the html source)

So I'll have not problem to use this "big" clientId, just, maybe a
"o_a_m_id" would make it too.


Mike Kienenberger wrote:
> Finally, I proposed on the other thread that we allow the web.xml file
> to define the unique prefix.  Unfortunately, I noticed now that the
> value has been declared final.
Yep, not only final - more problematic it is static. What might be
possible is to use system properties - at least a way to configure it then.

Ciao,
Mario


RE: MyFaces and HTML 4.01

Posted by "Beelen, Marco" <ma...@merck.com>.
Helllo,

In order 'choose' an unique prefix, why not re-use a common way to
create unique names in Java: Use a package-structure.
There for until it can be configured in the web.xml how about using
"org_apache_myfaces_" as the clientID-prefix.

I know it's not as short as "_id", but I seriously doubt anybody using
that ID for a component in their application. ( Except possibly the
myfaces-examples-application )

Just my thought.

With kind regards,
  Marco Beelen


 

-----Original Message-----
From: Mike Kienenberger [mailto:mkienenb@gmail.com] 
Sent: vrijdag 20 april 2007 17:11
To: MyFaces Development
Subject: Re: MyFaces and HTML 4.01

I did a quick search, and this issue has come up at least twice
before, but the responses to keeping the current behavior were
unconvincing.

5/20/2005  Serious problems with MyFaces ID allocation which is not
conform to XHTML!
7/12/2006  w3c Markup validator does not like generated ID's after
MyFaces version 1.1.1

There's nothing in the spec that says we must use underscore (_) for a
clientID prefix.   In fact, the spec (and javadocs) are pretty clear
that we can provide any prefix we like so long as it is "unique".
It's also recommended that it be short :-)

Now a server-side id limited to [A-Z_-].  What are the limitations of
a client-side id for xhtml and html?   Maybe there's another character
we can use that's not allowed in a server-side id.  I know that colon
is also allowed client-side.  Either that or we pick something and
hope users won't use the same prefix, like mc_, mf_, mm_, zz, or qq_.

Finally, I proposed on the other thread that we allow the web.xml file
to define the unique prefix.  Unfortunately, I noticed now that the
value has been declared final.  It might still be possible to allow
the user to configure it at startup, but that will probably make it
more difficult.


On 4/20/07, Simon Lessard <si...@gmail.com> wrote:
> Hello everyone,
>
> This thread is a follow-up for user@myface.apache.org thread about
HTML 4.01
> compliance. As mentioned in that thread, JSF spec requires implementor
to
> provide a HTML 4.01 compliant renderkit (Section 8.5). However, both
JSF RI
> and MyFaces cannot currently ensure that. One of the reason is the
prefix
> used for generated ids. Currently UIViewRoot.UNIQUE_PREFIX_ID = "_id".
> However, W3C does not allow ids starting with an underscore (see
> http://www.w3.org/TR/html401/struct/global.html#h-7.5.2 and
> http://www.w3.org/TR/html401/types.html#type-name ).
>
> Therefore, I think the value of UNIQUE_PREFIX_ID should be changed to
> something like "mf_id" in order to comply with the spec, even if RI
does
> not.
>
>
> Regards,
>
> ~Simon
>
>
> Original thread can be found at
>
http://mail-archives.apache.org/mod_mbox/myfaces-users/200704.mbox/brows
er,
> thread named XHTML Strict
>




------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD
and in Japan, as Banyu - direct contact information for affiliates is 
available at http://www.merck.com/contact/contacts.html) that may be 
confidential, proprietary copyrighted and/or legally privileged. It is 
intended solely for the use of the individual or entity named on this 
message. If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then 
delete it from your system.

------------------------------------------------------------------------------

Re: MyFaces and HTML 4.01

Posted by Mike Kienenberger <mk...@gmail.com>.
I did a quick search, and this issue has come up at least twice
before, but the responses to keeping the current behavior were
unconvincing.

5/20/2005  Serious problems with MyFaces ID allocation which is not
conform to XHTML!
7/12/2006  w3c Markup validator does not like generated ID's after
MyFaces version 1.1.1

There's nothing in the spec that says we must use underscore (_) for a
clientID prefix.   In fact, the spec (and javadocs) are pretty clear
that we can provide any prefix we like so long as it is "unique".
It's also recommended that it be short :-)

Now a server-side id limited to [A-Z_-].  What are the limitations of
a client-side id for xhtml and html?   Maybe there's another character
we can use that's not allowed in a server-side id.  I know that colon
is also allowed client-side.  Either that or we pick something and
hope users won't use the same prefix, like mc_, mf_, mm_, zz, or qq_.

Finally, I proposed on the other thread that we allow the web.xml file
to define the unique prefix.  Unfortunately, I noticed now that the
value has been declared final.  It might still be possible to allow
the user to configure it at startup, but that will probably make it
more difficult.


On 4/20/07, Simon Lessard <si...@gmail.com> wrote:
> Hello everyone,
>
> This thread is a follow-up for user@myface.apache.org thread about HTML 4.01
> compliance. As mentioned in that thread, JSF spec requires implementor to
> provide a HTML 4.01 compliant renderkit (Section 8.5). However, both JSF RI
> and MyFaces cannot currently ensure that. One of the reason is the prefix
> used for generated ids. Currently UIViewRoot.UNIQUE_PREFIX_ID = "_id".
> However, W3C does not allow ids starting with an underscore (see
> http://www.w3.org/TR/html401/struct/global.html#h-7.5.2 and
> http://www.w3.org/TR/html401/types.html#type-name ).
>
> Therefore, I think the value of UNIQUE_PREFIX_ID should be changed to
> something like "mf_id" in order to comply with the spec, even if RI does
> not.
>
>
> Regards,
>
> ~Simon
>
>
> Original thread can be found at
> http://mail-archives.apache.org/mod_mbox/myfaces-users/200704.mbox/browser,
> thread named XHTML Strict
>