rest - jboss 6 dojo error 415 Unsupported Media Type -
i know error quite common, things i've read , tried , nothing works.
@get @path("test") @produces(mediatype.application_json + ";charset=utf-8") //@produces(mediatype.text_html) //@produces(mediatype.text_plain) public string test() { return "{\"name\":\"stewie\"}"; }
and in dojo
xhr("/csh/rest/test/", { handleas : "json" // headers: {"accept", "application/json"} }).then(function(data) { console.log(data); });
it works fine in tomcat 7. not in jboss 6.
please note not using resteasy, jersey.
thank much.
it comes down this: dojo sucks. how come in official documentation find things tagged "not known @ time" ?
the answer problem switch jquery. here , there had specify datatype="json" in call , it.
Comments
Post a Comment