• [프로그래밍] Json response in spring mvc 3.02011.10.28 AM 09:20

게시물 주소 FONT글자 작게하기 글자 키우기

YourRespone is Java object to be returned to a requeter.
Using MappingJacksonHttpMessageConverter required code.haus.jackson library


YourResponse yourRespone = new YourRespone(param);

MappingJacksonHttpMessageConverter jsonConverter = new MappingJacksonHttpMessageConverter();
MediaType jsonMimeType = MediaType.APPLICATION_JSON;
if (jsonConverter.canWrite(accountResponse.getClass(), jsonMimeType)) {
try {
jsonConverter.write(accountResponse, jsonMimeType, new ServletServerHttpResponse(response));
} catch (IOException m_Ioe) {
// TODO: announce this exception somehow
} catch (HttpMessageNotWritableException p_Nwe) {
// TODO: announce this exception somehow
}
댓글 : 0 개
친구글 비밀글 댓글 쓰기

user error : Error. B.