context.xml 에 추가
1
2
3
4
5
6
7
|
< mvc:annotation-driven >
< mvc:message-converters register-defaults = "true" >
< bean class = "org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" >
< property name = "supportedMediaTypes" value = "text/plain;charset=UTF-8" />
</ bean >
</ mvc:message-converters >
</ mvc:annotation-driven >
|
Controller 추가
1
2
3
4
|
public @ResponseBody Map<?,?> listJson( @RequestParam Map<String, Object> paramMap, ModelMap model) throws Throwable{
model.put( "results" , mainService.getList(paramMap));
return model;
}
|
|
[출처:JAVA Project - Spring 강좌]
댓글 없음:
댓글 쓰기