Search in sources :

Example 6 with ResponseJSONP

use of com.alibaba.fastjson.support.spring.annotation.ResponseJSONP in project fastjson by alibaba.

the class FastJsonViewAndJSONPControllerTest method test2.

@ResponseJSONP
@RequestMapping("test2")
@FastJsonView(exclude = { @FastJsonFilter(clazz = Company.class, props = { "id", "name" }) })
public Company test2() {
    Company company = new Company();
    company.setId(100L);
    company.setName("测试");
    company.setDescription("fastjsonview注解测试");
    company.setStock("haha");
    return company;
}
Also used : Company(com.alibaba.json.test.entity.Company) FastJsonView(com.alibaba.fastjson.support.spring.annotation.FastJsonView) ResponseJSONP(com.alibaba.fastjson.support.spring.annotation.ResponseJSONP) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ResponseJSONP (com.alibaba.fastjson.support.spring.annotation.ResponseJSONP)6 FastJsonView (com.alibaba.fastjson.support.spring.annotation.FastJsonView)4 Company (com.alibaba.json.test.entity.Company)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 JSONPObject (com.alibaba.fastjson.JSONPObject)2 Department (com.alibaba.json.test.entity.Department)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 ServletServerHttpRequest (org.springframework.http.server.ServletServerHttpRequest)2