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