Right. Well it's the other cases I'm worried about. I would rather not
have the decision in the Trinidad code whether to encode the URL or
not. We should always be encoding unless we're certain they are
bookmarks. Otherwise, presumably, the app server or portal will handle
it accordingly. Is that not correct?
Scott
Matt Cooper wrote:
> If the link's destination starts with "#" then yes; if the destination
> doesn't start with "http://", "https://", "mailto:", "javascript:" or
> anything else.
>
> On 11/29/06, Scott O'Bryan <[EMAIL PROTECTED]> wrote:
>>
>> So they will basically reference bookmarks, correct?
>>
>> Scott
>>
>> Adam Winer wrote:
>> > Neither; they do not need to be encoded at all, as they
>> > are only references within a page.
>> >
>> > -- Adam
>> >
>> >
>> > On 11/28/06, Qiang Fan <[EMAIL PROTECTED]> wrote:
>> >> Adam:
>> >>
>> >> I asked the question because I am working on a patch for encoding
>> >> URLs in
>> >> trinidad. I need to know whether to encode the URL as Action
URL or
>> >> Resource
>> >> URL.
>> >>
>> >> For the following scenarios I guess they should all be encoded as
>> Action
>> >> URL. But I am not sure. Just want to confirm with you.
>> >>
>> >> In HeaderRenderer (in this case only name is rendered and I did
not
>> >> see id
>> >> for it):
>> >>
>> >> renderURIAttribute(context, NAME_ATTRIBUTE, label);
>> >>
>> >> And in LinkRenderer:
>> >>
>> >> protected void renderID(
>> >> UIXRenderingContext context,
>> >> UINode node
>> >> ) throws IOException
>> >> {
>> >> Object id = getID(context, node);
>> >>
>> >> if (id != null)
>> >> {
>> >> if (supportsID(context))
>> >> {
>> >> // For links, "name" and thus "id" is a URI attribute.
>> >> renderURIID(context, id);
>> >> }
>> >>
>> >> if (supportsNameIdentification(context) &&
>> >> makeNameAndIDSame(context))
>> >> {
>> >> renderURIAttribute(context, "name", id);
>> >> }
>> >> }
>> >> }
>> >> Are they all Action URLs?
>> >>
>> >> Thanks.
>> >>
>> >> John
>> >>
>> >>
>> >> On 11/28/06, Adam Winer <[EMAIL PROTECTED]> wrote:
>> >> >
>> >> > The value of the attribute on "name" on GoLink will end up
mapping
>> >> > up to "href" on some other link. So it really is a URI.
>> >> > E.g., you need to use % encoding, not & encoding.
>> >> > And "id" must equal "name".
>> >> >
>> >> > -- Adam
>> >> >
>> >> >
>> >> >
>> >> > On 11/28/06, Qiang Fan <[EMAIL PROTECTED]> wrote:
>> >> > > In GoLinkRenderer class, there is the following method:
>> >> > >
>> >> > > @Override
>> >> > > protected void renderId(
>> >> > > FacesContext context,
>> >> > > UIComponent component) throws IOException
>> >> > > {
>> >> > > if (shouldRenderId(context, component))
>> >> > > {
>> >> > > String clientId = getClientId(context, component);
>> >> > > // For links, these are actually URI attributes
>> >> > > context.getResponseWriter().writeURIAttribute("id",
>> clientId,
>> >> > "id");
>> >> > > context.getResponseWriter().writeURIAttribute("name",
>> >> clientId,
>> >> > "id");
>> >> > > }
>> >> > > }
>> >> > >
>> >> > > Why are id and name rendered as URI? Are the id and name
used as
>> >> URI in
>> >> > > javascript logic? I saw some similar code in several other
>> >> classes too.
>> >> > >
>> >> > > Thanks.
>> >> > >
>> >> > > John Fan
>> >> > >
>> >> > >
>> >> >
>> >>
>> >>
>> >
>>
>>
>