[Geoserver-devel] [jira] Created: (GEOS-4680) double encoding of special characters in WFS service exceptions

double encoding of special characters in WFS service exceptions
---------------------------------------------------------------

                 Key: GEOS-4680
                 URL: https://jira.codehaus.org/browse/GEOS-4680
             Project: GeoServer
          Issue Type: Bug
          Components: WFS
            Reporter: Tim Schaub
            Assignee: Andrea Aime

When I do this:

{code}
    throw new WFSException("\"foo\" & <bar>");
{code}

The client gets this:

{code:xml}
<?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&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:ows="http://www.opengis.net/ows&quot;&gt;
  <ows:Exception exceptionCode="NoApplicableCode">
    <ows:ExceptionText>&amp;quot;foo&amp;quot; &amp;amp; &amp;lt;bar&amp;gt;</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>
{code}

But should get this:

{code:xml}
<?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&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:ows="http://www.opengis.net/ows&quot;&gt;
  <ows:Exception exceptionCode="NoApplicableCode">
    <ows:ExceptionText>"foo" &amp; &lt;bar&gt;</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>
{code}

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@anonymised.com

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