Menu

#129 Ajax DisplayTag Exception, when using data HTML Entities

JSP_Tags
open
nobody
JSP Tags (38)
5
2013-01-31
2011-06-24
Anonymous
No

When displaying data with HTML entities, such as " ", "ä" a SAXParseException is thrown, when generating the XML document.

Stack trace:
Caused by: org.xml.sax.SAXParseException: The entity "nbsp" was referenced, but not declared.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at eu.gumpinger.erp.dao.utils.DocumentBuilderFactory$MyDocumentBuilder.parse(DocumentBuilderFactory.java:68) // --> (all this does, is wrap the call to the standard DocumentBuilderFactory implementation)
at net.sourceforge.ajaxtags.helpers.XMLUtils.getXMLDocument(XMLUtils.java:160)
at net.sourceforge.ajaxtags.tags.AjaxAnchorsTag.getDocument(AjaxAnchorsTag.java:141)
at net.sourceforge.ajaxtags.tags.AjaxDisplayTag.processContent(AjaxDisplayTag.java:147)
at net.sourceforge.ajaxtags.tags.AjaxAreaTag.doEndTag(AjaxAreaTag.java:99)
at org.apache.jsp.WEB_002dINF.tiles.basics.home_jsp._jspService(home_jsp.java:459)
... 63 more

This can easily reproduced, by modifying the displaytag.properties file, for example:
paging.banner.some_items_found=<span class="pagebanner">{0} {1} found, displaying {2} to {3}.&nbsp;&nbsp;&nbsp;</span>
will produce the error shown above.

Discussion

MongoDB Logo MongoDB