[
http://jira.codehaus.org/browse/DISPL-387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_113857
]
Don Mornes commented on DISPL-387:
----------------------------------
Dmitri Schoeman,
Shouldn't you use StringEscapeUtils.escapeXml when the media type is XML?
Here is my decorator.
package graco.service.util;
import javax.servlet.jsp.PageContext;
import org.displaytag.decorator.DisplaytagColumnDecorator;
import org.displaytag.exception.DecoratorException;
import org.displaytag.properties.MediaTypeEnum;
import org.apache.commons.lang.StringEscapeUtils;
/**
* Simple column decorator which escapes HTML.
* @author Don Mornes
* @version $Revision: 1.0 $ ($Author: qadhm1 $)
*/
public class EscapeHtmlWrapper implements DisplaytagColumnDecorator {
/**
* transform the String with escapeHTML
* @see
org.displaytag.decorator.DisplaytagColumnDecorator#decorate(Object,
PageContext, MediaTypeEnum)
*/
public Object decorate(
Object columnValue,
PageContext pageContext,
MediaTypeEnum media)
throws DecoratorException
{
if (columnValue == null) {
return columnValue;
} else
if (media.equals(MediaTypeEnum.HTML)) {
return
StringEscapeUtils.escapeHtml((String)columnValue);
} else
if (media.equals(MediaTypeEnum.XML)) {
return StringEscapeUtils.escapeXml((String)columnValue);
} else {
return columnValue;
}
}
}
> problem for single quote escaping for single quote character in displaytag
> column tags using escapeXML="true"
> --------------------------------------------------------------------------------------------------------------
>
> Key: DISPL-387
> URL: http://jira.codehaus.org/browse/DISPL-387
> Project: DisplayTag
> Issue Type: Bug
> Reporter: ruth shacter
>
> It appears that displaytag escapes (when escapeXml="true") a single quote
> with '
> c:out and bean:write tags escape it with '
> The problem is that while Firefox and Safari understand ', Internet
> Explorer does not. All three browsers understand '.
> This means that all single quotes in displaytag tables will appear as ugly
> "'".
> This might be related to issue: maven-83: xdocs entity encoding problem for
> single quote
> If there is a known workaround, could you let me know? thanks.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
displaytag-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel