You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Michael Wyraz (JIRA)" <ji...@apache.org> on 2011/03/07 16:20:59 UTC
[jira] Commented: (TAP5-714) Incorrect encoding of single quotes
for Ajax requests
[ 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'reilly' id='addressLine1-1215dd60f22'
> name='addressLine1' type='text'><\/input>
> which renders as "o'reilly" in Firefox, but in IE the value renders as
> "o'reilly". According to
> http://cssvault.com/blog/2007/10/17/internet-explorer-apos-feature/ , it
> should be rendering out ' instead.
> I've looked into where the ' 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