Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

求原生支持jackson的jsonp功能和属性命名策略 #699

Closed
w6et opened this issue Jun 28, 2016 · 5 comments
Closed

求原生支持jackson的jsonp功能和属性命名策略 #699

w6et opened this issue Jun 28, 2016 · 5 comments
Milestone

Comments

@w6et
Copy link

w6et commented Jun 28, 2016

属性命名策略:
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"> <property name="objectMapper"> <bean class="com.fasterxml.jackson.databind.ObjectMapper"> <property name="propertyNamingStrategy"> <bean class="com.fasterxml.jackson.databind.PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy" /> </property> </bean> </property> </bean>

jsonp支持:
org.springframework.web.servlet.mvc.method.annotation.AbstractJsonpResponseBodyAdvice

@githublaohu
Copy link

你是想,实现jsonp对吧,
我觉得,作者会支持这个的。
这周,我尝试写下。

@wenshao
Copy link
Member

wenshao commented Jun 29, 2016

很好的需求,将会尽快支持

@wenshao wenshao added this to the 1.2.14 milestone Jun 29, 2016
@wenshao wenshao modified the milestones: 1.2.15, 1.2.14 Jul 15, 2016
@wenshao
Copy link
Member

wenshao commented Jul 17, 2016

你能介绍一下使用场景么?

@w6et
Copy link
Author

w6et commented Jul 18, 2016

1,propertyNamingStrategy:
这种场景是请求参数是user_name,可以直接映射到java bean的userName属性上;响应参数也可以把userName映射为user_name
2,AbstractJsonpResponseBodyAdvice
这种场景是当请求参数有?callback=test,那么就可以生成函数名为test的jsonp数据,而不用每个requestMapping对应的方法都写一遍

@wenshao
Copy link
Member

wenshao commented Jul 30, 2016

已经支持,文档在这里
https://github.com/alibaba/fastjson/wiki/PropertyNamingStrategy_cn

@wenshao wenshao closed this as completed Jul 30, 2016
asa1997 pushed a commit to Be-Secure/fastjson that referenced this issue Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants