본문 바로가기

emotional developer/detect-Java

spring 4.1 JSONP support



https://spring.io/blog/2014/07/28/spring-framework-4-1-spring-mvc-improvements


JSONP is now supported with Jackson.
For response body methods declare an @ControllerAdvice as shown below.
For View-based rendering simply configure the JSONP query parameter name(s)
on MappingJackson2JsonView.

@ControllerAdvice
private static class JsonpAdvice extends AbstractJsonpResponseBodyAdvice {

    public JsonpAdvice() {
        super("callback");
    }

}


다만. 아래와 같은 이슈가 있으니, 재정의가 좀 필요하다.


http://nz.pe.kr/?p=2673







반응형

'emotional developer > detect-Java' 카테고리의 다른 글

httpclient cookie 설정.  (0) 2015.07.31
slf4j multiple bindings error  (0) 2015.07.26
[spring] basePackages vs basePackageClasses  (0) 2015.06.19