java - Returning String using REST Endpoint -
before minus question, should know searched solution , didn't find it.
i want return string rest endpoint:
@get @path("/getmystring") @produces({ mediatype.application_json }) public response getid() { string s = "this string"; (...) return response.ok(s).build(); } but in view receive char array (result in firebug):
resource { 0="t", 1="h", 2="i", more...} in front use angular resource like:
blablaresources.factory('angularapp', [ '$resource', function($resource) { return $resource(contextpath + '/.rest/v1/someservice', {}, { (... other methods ...) getstring : { method : 'get', url : contextpath + '/.rest/v1/someservice/getmystring' } }); } ]); is there wrapper class string or annotation send like:
resource { value = "this string" } or normal
"this string" thanks constructive response :)
try use
@produces({ mediatype.text_plain })
Comments
Post a Comment