Details
Description
When I do this:
throw new WFSException("\"foo\" & <bar>");
The client gets this:
<?xml version="1.0" encoding="UTF-8"?> <ows:ExceptionReport version="1.0.0" xsi:schemaLocation="http://www.opengis.net/ows http://localhost:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows"> <ows:Exception exceptionCode="NoApplicableCode"> <ows:ExceptionText>&quot;foo&quot; &amp; &lt;bar&gt;</ows:ExceptionText> </ows:Exception> </ows:ExceptionReport>
But should get this:
<?xml version="1.0" encoding="UTF-8"?> <ows:ExceptionReport version="1.0.0" xsi:schemaLocation="http://www.opengis.net/ows http://localhost:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows"> <ows:Exception exceptionCode="NoApplicableCode"> <ows:ExceptionText>"foo" & <bar></ows:ExceptionText> </ows:Exception> </ows:ExceptionReport>
I can fix this by calling OWSUtils.dumpExceptionMessages (DefaultServiceExceptionHandler.java line 77) with xmlEscape false, but I haven't checked to see what else this breaks.
This is using the trunk@16179.
Handle character entities in exception text.