Hi Louis,

Thanks for the report. I've just fixed it in SVN trunk.

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Technical Lead ~ http://www.restlet.org
Noelios Technologies ~ http://www.noelios.com



-----Message d'origine-----
De : Louis Huh [mailto:[email protected]] 
Envoyé : dimanche 6 juin 2010 08:52
À : [email protected]
Objet : Re: json result with xml header

I think it is a bug.

It has to be fixed in "XStreamRepresentation.write" method 

//below is the method code

    @Override
    public void write(Writer writer) throws IOException {
        if (representation != null) {
            representation.write(writer);
        } else if (object != null) {
            CharacterSet charSet = (getCharacterSet() == null) ?
CharacterSet.ISO_8859_1
                    : getCharacterSet();

            writer.append("<?xml version=\"1.0\" encoding=\""
                    + charSet.getName() + "\" ?>\n");
            getXstream().toXML(object, writer);
        }
    }

------------------------------

please check it, 

It writes xml header always, I think it should check mediaType and it
decide.




-- 
View this message in context:
http://restlet-discuss.1400322.n2.nabble.com/json-result-with-xml-header-tp5
142059p5144803.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=26174
79

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2617546

Reply via email to