tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Wyraz (JIRA)" <j...@apache.org>
Subject [jira] Commented: (TAP5-714) Incorrect encoding of single quotes for Ajax requests
Date Mon, 07 Mar 2011 15:20:59 GMT

    [ https://issues.apache.org/jira/browse/TAP5-714?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13003388#comment-13003388
] 

Michael Wyraz commented on TAP5-714:
------------------------------------

On Typestry 5.1.0.5 this can be easily fixed by creating a module which overrides the Service
"MarkupWriterFactory":

    /**
     * Bugfixes for Tapestry 5.0.1.5 Bugs
     * http://tapestry.apache.org/tapestry5/tapestry-ioc/cookbook/override.html
     * 
     * - https://issues.apache.org/jira/browse/TAP5-714 Incorrect encoding of single quotes
for Ajax requests
     * 
     */
    public static void bind(ServiceBinder binder)
    {
        binder.bind(MarkupWriterFactory.class, MarkupWriterFactoryImplBugfix.class).withId("Override");
    }
    @SuppressWarnings("rawtypes")
    public static void contributeServiceOverride(MappedConfiguration<Class,Object> configuration,
@Local MarkupWriterFactory override)
    {
        configuration.add(MarkupWriterFactory.class, override);
    }

MarkupWriterFactoryImplBugfix is a copy of MarkupWriterFactoryImpl that uses "DefaultMarkupModelBugfix"
and "XMLMarkupModelBugfix". These both are copies of "XMLMarkupModel" and "XMLMarkupModel"
which extends "AbstractMarkupModelBugfix".
AbstractMarkupModelBugfix extends AbstractMarkupModel and have a copy of method "encodeQuoted(String
content, StringBuilder builder)" with the patch below applied.

Since most things in these classes are final or private, everything has to be copied :-(


> Incorrect encoding of single quotes for Ajax requests
> -----------------------------------------------------
>
>                 Key: TAP5-714
>                 URL: https://issues.apache.org/jira/browse/TAP5-714
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Ciaran Wood
>            Assignee: Thiago H. de Paula Figueiredo
>            Priority: Minor
>             Fix For: 5.2.0, 5.1.0.6, 5.1.0.7
>
>         Attachments: TAP-714.patch, TAP5-714-5.1.txt
>
>
> I've encountered what I think is a bug in the rendering of an ajax response.
> Basically, we're returning a block that contains a textfield component. The
> value of that textfield component is something with a single quote in it,
> for example "o'reilly". The response markup for that textfield is:
> <input value='o&apos;reilly' id='addressLine1-1215dd60f22'
> name='addressLine1' type='text'><\/input>
> which renders as "o'reilly" in Firefox, but in IE the value renders as
> "o&apos;reilly". According to
> http://cssvault.com/blog/2007/10/17/internet-explorer-apos-feature/ , it
> should be rendering out &#39; instead.
> I've looked into where the &apos; is coming from and its in the
> AbstractMarkupModel class, in the encodeQuoted() method (around line 132). 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message