質問

I have a Spring and Jersey application and has that line:

return Response.ok().header("Content-Type", "application/xml; charset=UTF-8").entity(restTemplate.postForObject(baseURL, entity, String.class)).build();

However when I debug at server side I see that Content-Type header is just application/xml. Any ideas?

役に立ちましたか?

解決

However when I debug at server side I see that Content-Type header is just application/xml

I am getting this in my code and during debug I can see the header which is proper.

Please verify.

I don't know but Sorry if I went wrong.

enter image description here

他のヒント

You have to set a separate header with

.header("charset", "UTF-8")

Seems like Jersey is reading the header value only upto the semicolon.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top