You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Grant Smith <wo...@gmail.com> on 2005/11/08 21:14:10 UTC
Extended versions of and
In response to:
http://issues.apache.org/jira/browse/MYFACES-407
I would like to suggest adding two new extended components to be able to
handle the escape attribute at the item level for the select* components. I
have begun implementing this functionality to the parent tomahawk
components.
Does this require a vote ? Do they have to go through the sandbox first (I'm
hoping not, as they're not really "new" components) ?
--
Grant Smith
Re: Extended versions of and
Posted by Grant Smith <wo...@gmail.com>.
I agree wholeheartedly about the .jsp format being painful. Unfortunately,
I'd bet that the majority of JSF users out there still use it. Our examples
are still in this format, too.
I'm going to go ahead and finnish up the extended versions o f these
components, as there really isn't any harm in supporting the escape
attribute for people who are stuck for whatever reason using .jsp format.
I'll slap together some new examples showing off the escape attribute, as
well as the alternative of using unicode in .jspx.
Thanks for spelling all this out for me :)
On 11/9/05, Adam Winer <aw...@gmail.com> wrote:
>
> Well, it all depends on where the text is coming from; but, say it's
> coming from a Java ListResourceBundle; instead of containing:
>
> "ꯍ"
>
> it should contain:
>
> "\uabcd"
>
> If it was hardcoded in a .jspx documents, or in any XML file, then an NCR
> is great, since that'll get decoded by the XML processor, be seen
> as a Java Unicode character, not an NCR string, and again be
> handled fine.
>
> The only significant issue I really see is when you're dealing with
> ordinary .jsp files, where you don't have Unicode escaping, NCRs
> don't get decoded before being passed to Java, etc., and you're
> forced to either resort to NCRs + escape="false" or to entering
> characters directly in the target character set.
>
> And, my harsh answer to that problem is that developers should stop
> using old-style .jsp file format, which is hideous, and use .jspx
> documents
> instead.
>
> -- Adam
>
>
>
> On 11/8/05, Grant Smith <wo...@gmail.com> wrote:
> > Adam, I'm not quite sure I understand what you're saying here. Can you
> give
> > an example in the context of the original user's problem ?
> >
> > On 11/8/05, Adam Winer <aw...@gmail.com> wrote:
> > > On 11/8/05, Grant Smith <work.grant@gmail.com > wrote:
> > > > In general this is true. However, there are legitimate reasons for
> using
> > NCR
> > > > over Unicode. See
> > > >
> > > >
> > http://www.w3.org/International/questions/qa-escapes.html
> > > >
> > > > for some of them. I'd like to see both options available.
> > >
> > > As I see it, this refers to using NCRs over UTF-8/UTF-16, etc. encoded
> > > text. Not what I'm talking about.
> > >
> > > I'm talking about Java-unicode-escaped text. E.g. "\u82eb", such that
> > > the Java strings you pass to JSF are Unicode, This is, IMO, always
> > > preferable - when you're holding onto a Java java.lang.String object,
> > > it should be Unicode escaped.
> > >
> > > The issue of how you store those strings and escape them when they're
> > > stored externally to your Java code (resource bundle, database, etc.)
> > > is a separate question, and should be whatever is natural to that
> > > datastore. All I'm saying is that when you get it actually into
> > > Java,. NCRs are bogus, pure Unicode is the right way to go, and then
> > > you let JSF handle the escaping for you.
> > >
> > > At any rate, escape="false" assumes that you're writing the text out
> > > as a text node, which will never work for <h:inputText>, for example,
> > > since it's written as a "value" attribute. So, right there you've got
> > > a case where NCRs are dead in the water. And it's a bad move to
> > > encourage people to set escape="false" all over the place, 'cause then
> > > they're opening themselves up to cross-site scripting attacks.
> > >
> > > -- Adam Winer
> > >
> >
> >
> >
> > --
> > Grant Smith
> >
>
--
Grant Smith
Re: Extended versions of and
Posted by Adam Winer <aw...@gmail.com>.
Well, it all depends on where the text is coming from; but, say it's
coming from a Java ListResourceBundle; instead of containing:
"ꯍ"
it should contain:
"\uabcd"
If it was hardcoded in a .jspx documents, or in any XML file, then an NCR
is great, since that'll get decoded by the XML processor, be seen
as a Java Unicode character, not an NCR string, and again be
handled fine.
The only significant issue I really see is when you're dealing with
ordinary .jsp files, where you don't have Unicode escaping, NCRs
don't get decoded before being passed to Java, etc., and you're
forced to either resort to NCRs + escape="false" or to entering
characters directly in the target character set.
And, my harsh answer to that problem is that developers should stop
using old-style .jsp file format, which is hideous, and use .jspx documents
instead.
-- Adam
On 11/8/05, Grant Smith <wo...@gmail.com> wrote:
> Adam, I'm not quite sure I understand what you're saying here. Can you give
> an example in the context of the original user's problem ?
>
> On 11/8/05, Adam Winer <aw...@gmail.com> wrote:
> > On 11/8/05, Grant Smith <work.grant@gmail.com > wrote:
> > > In general this is true. However, there are legitimate reasons for using
> NCR
> > > over Unicode. See
> > >
> > >
> http://www.w3.org/International/questions/qa-escapes.html
> > >
> > > for some of them. I'd like to see both options available.
> >
> > As I see it, this refers to using NCRs over UTF-8/UTF-16, etc. encoded
> > text. Not what I'm talking about.
> >
> > I'm talking about Java-unicode-escaped text. E.g. "\u82eb", such that
> > the Java strings you pass to JSF are Unicode, This is, IMO, always
> > preferable - when you're holding onto a Java java.lang.String object,
> > it should be Unicode escaped.
> >
> > The issue of how you store those strings and escape them when they're
> > stored externally to your Java code (resource bundle, database, etc.)
> > is a separate question, and should be whatever is natural to that
> > datastore. All I'm saying is that when you get it actually into
> > Java,. NCRs are bogus, pure Unicode is the right way to go, and then
> > you let JSF handle the escaping for you.
> >
> > At any rate, escape="false" assumes that you're writing the text out
> > as a text node, which will never work for <h:inputText>, for example,
> > since it's written as a "value" attribute. So, right there you've got
> > a case where NCRs are dead in the water. And it's a bad move to
> > encourage people to set escape="false" all over the place, 'cause then
> > they're opening themselves up to cross-site scripting attacks.
> >
> > -- Adam Winer
> >
>
>
>
> --
> Grant Smith
>
Re: Extended versions of and
Posted by Grant Smith <wo...@gmail.com>.
Adam, I'm not quite sure I understand what you're saying here. Can you give
an example in the context of the original user's problem ?
On 11/8/05, Adam Winer <aw...@gmail.com> wrote:
>
> On 11/8/05, Grant Smith <wo...@gmail.com> wrote:
> > In general this is true. However, there are legitimate reasons for using
> NCR
> > over Unicode. See
> >
> > http://www.w3.org/International/questions/qa-escapes.html
> >
> > for some of them. I'd like to see both options available.
>
> As I see it, this refers to using NCRs over UTF-8/UTF-16, etc. encoded
> text. Not what I'm talking about.
>
> I'm talking about Java-unicode-escaped text. E.g. "\u82eb", such that
> the Java strings you pass to JSF are Unicode, This is, IMO, always
> preferable - when you're holding onto a Java java.lang.String object,
> it should be Unicode escaped.
>
> The issue of how you store those strings and escape them when they're
> stored externally to your Java code (resource bundle, database, etc.)
> is a separate question, and should be whatever is natural to that
> datastore. All I'm saying is that when you get it actually into
> Java,. NCRs are bogus, pure Unicode is the right way to go, and then
> you let JSF handle the escaping for you.
>
> At any rate, escape="false" assumes that you're writing the text out
> as a text node, which will never work for <h:inputText>, for example,
> since it's written as a "value" attribute. So, right there you've got
> a case where NCRs are dead in the water. And it's a bad move to
> encourage people to set escape="false" all over the place, 'cause then
> they're opening themselves up to cross-site scripting attacks.
>
> -- Adam Winer
>
--
Grant Smith
Re: Extended versions of and
Posted by Adam Winer <aw...@gmail.com>.
On 11/8/05, Grant Smith <wo...@gmail.com> wrote:
> In general this is true. However, there are legitimate reasons for using NCR
> over Unicode. See
>
> http://www.w3.org/International/questions/qa-escapes.html
>
> for some of them. I'd like to see both options available.
As I see it, this refers to using NCRs over UTF-8/UTF-16, etc. encoded
text. Not what I'm talking about.
I'm talking about Java-unicode-escaped text. E.g. "\u82eb", such that
the Java strings you pass to JSF are Unicode, This is, IMO, always
preferable - when you're holding onto a Java java.lang.String object,
it should be Unicode escaped.
The issue of how you store those strings and escape them when they're
stored externally to your Java code (resource bundle, database, etc.)
is a separate question, and should be whatever is natural to that
datastore. All I'm saying is that when you get it actually into
Java,. NCRs are bogus, pure Unicode is the right way to go, and then
you let JSF handle the escaping for you.
At any rate, escape="false" assumes that you're writing the text out
as a text node, which will never work for <h:inputText>, for example,
since it's written as a "value" attribute. So, right there you've got
a case where NCRs are dead in the water. And it's a bad move to
encourage people to set escape="false" all over the place, 'cause then
they're opening themselves up to cross-site scripting attacks.
-- Adam Winer
Re: Extended versions of and
Posted by Grant Smith <wo...@gmail.com>.
In general this is true. However, there are legitimate reasons for using NCR
over Unicode. See
http://www.w3.org/International/questions/qa-escapes.html
for some of them. I'd like to see both options available.
On 11/8/05, Adam Winer <aw...@gmail.com> wrote:
>
> FWIW, I think the issue is rather lame. The reporter is, for
> some reason, storing characters as numerical character
> references. If the characters were stored as plain Unicode
> (or unescaped back into plain Unicode) as they should be,
> then there'd be no issues. In other words, the user can solve
> his own problem without any API changes.
>
> The only really legit use case for escape="false" on a selectItem
> is for something like selectManyCheckbox, if you wanted to
> have HTML formatting in the label.
>
> Cheers,
> Adam Winer
>
>
>
> On 11/8/05, Grant Smith <wo...@gmail.com> wrote:
> > OK, sandbox it is then :)
> >
> >
> > On 11/8/05, Sean Schofield <se...@gmail.com> wrote:
> > > I would say that they are new components and that they should go in
> > > the sandbox first. If they are really that simple we could vote them
> > > out once every one has a chance to see them (perhaps with a few other
> > > components that might be ready - scheduler jumps to mind.)
> > >
> > > IMO putting stuff in the sandbox allows the person who wants to go
> > > forward with an idea to do so without forcing everyone else to decide
> > > on the merits of the idea without seeing it in action. Its also a
> > > quality control check on examples, javadoc, etc.
> > >
> > > On the other hand, I was thinking of adding a tag to an existing
> > > converter. That probably goes straight into tomahawk because the
> > > component is there already. Ultimately its a fuzzy line ...
> > >
> > > My .02
> > >
> > > sean
> > >
> > > On 11/8/05, Grant Smith <wo...@gmail.com> wrote:
> > > > In response to:
> > > >
> > > > http://issues.apache.org/jira/browse/MYFACES-407
> > > >
> > > > I would like to suggest adding two new extended components to be
> able to
> > > > handle the escape attribute at the item level for the select*
> > components. I
> > > > have begun implementing this functionality to the parent tomahawk
> > > > components.
> > > > Does this require a vote ? Do they have to go through the sandbox
> first
> > > > (I'm hoping not, as they're not really "new" components) ?
> > > >
> > > > --
> > > > Grant Smith
> > > >
> > >
> >
> >
> >
> > --
> > Grant Smith
> >
>
--
Grant Smith
Re: Extended versions of and
Posted by Adam Winer <aw...@gmail.com>.
FWIW, I think the issue is rather lame. The reporter is, for
some reason, storing characters as numerical character
references. If the characters were stored as plain Unicode
(or unescaped back into plain Unicode) as they should be,
then there'd be no issues. In other words, the user can solve
his own problem without any API changes.
The only really legit use case for escape="false" on a selectItem
is for something like selectManyCheckbox, if you wanted to
have HTML formatting in the label.
Cheers,
Adam Winer
On 11/8/05, Grant Smith <wo...@gmail.com> wrote:
> OK, sandbox it is then :)
>
>
> On 11/8/05, Sean Schofield <se...@gmail.com> wrote:
> > I would say that they are new components and that they should go in
> > the sandbox first. If they are really that simple we could vote them
> > out once every one has a chance to see them (perhaps with a few other
> > components that might be ready - scheduler jumps to mind.)
> >
> > IMO putting stuff in the sandbox allows the person who wants to go
> > forward with an idea to do so without forcing everyone else to decide
> > on the merits of the idea without seeing it in action. Its also a
> > quality control check on examples, javadoc, etc.
> >
> > On the other hand, I was thinking of adding a tag to an existing
> > converter. That probably goes straight into tomahawk because the
> > component is there already. Ultimately its a fuzzy line ...
> >
> > My .02
> >
> > sean
> >
> > On 11/8/05, Grant Smith <wo...@gmail.com> wrote:
> > > In response to:
> > >
> > > http://issues.apache.org/jira/browse/MYFACES-407
> > >
> > > I would like to suggest adding two new extended components to be able to
> > > handle the escape attribute at the item level for the select*
> components. I
> > > have begun implementing this functionality to the parent tomahawk
> > > components.
> > > Does this require a vote ? Do they have to go through the sandbox first
> > > (I'm hoping not, as they're not really "new" components) ?
> > >
> > > --
> > > Grant Smith
> > >
> >
>
>
>
> --
> Grant Smith
>
Re: Extended versions of and
Posted by Grant Smith <wo...@gmail.com>.
OK, sandbox it is then :)
On 11/8/05, Sean Schofield <se...@gmail.com> wrote:
>
> I would say that they are new components and that they should go in
> the sandbox first. If they are really that simple we could vote them
> out once every one has a chance to see them (perhaps with a few other
> components that might be ready - scheduler jumps to mind.)
>
> IMO putting stuff in the sandbox allows the person who wants to go
> forward with an idea to do so without forcing everyone else to decide
> on the merits of the idea without seeing it in action. Its also a
> quality control check on examples, javadoc, etc.
>
> On the other hand, I was thinking of adding a tag to an existing
> converter. That probably goes straight into tomahawk because the
> component is there already. Ultimately its a fuzzy line ...
>
> My .02
>
> sean
>
> On 11/8/05, Grant Smith <wo...@gmail.com> wrote:
> > In response to:
> >
> > http://issues.apache.org/jira/browse/MYFACES-407
> >
> > I would like to suggest adding two new extended components to be able to
> > handle the escape attribute at the item level for the select*
> components. I
> > have begun implementing this functionality to the parent tomahawk
> > components.
> > Does this require a vote ? Do they have to go through the sandbox first
> > (I'm hoping not, as they're not really "new" components) ?
> >
> > --
> > Grant Smith
> >
>
--
Grant Smith
Re: Extended versions of and
Posted by Sean Schofield <se...@gmail.com>.
I would say that they are new components and that they should go in
the sandbox first. If they are really that simple we could vote them
out once every one has a chance to see them (perhaps with a few other
components that might be ready - scheduler jumps to mind.)
IMO putting stuff in the sandbox allows the person who wants to go
forward with an idea to do so without forcing everyone else to decide
on the merits of the idea without seeing it in action. Its also a
quality control check on examples, javadoc, etc.
On the other hand, I was thinking of adding a tag to an existing
converter. That probably goes straight into tomahawk because the
component is there already. Ultimately its a fuzzy line ...
My .02
sean
On 11/8/05, Grant Smith <wo...@gmail.com> wrote:
> In response to:
>
> http://issues.apache.org/jira/browse/MYFACES-407
>
> I would like to suggest adding two new extended components to be able to
> handle the escape attribute at the item level for the select* components. I
> have begun implementing this functionality to the parent tomahawk
> components.
> Does this require a vote ? Do they have to go through the sandbox first
> (I'm hoping not, as they're not really "new" components) ?
>
> --
> Grant Smith
>