[
https://issues.apache.org/jira/browse/CXF-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13040175#comment-13040175
]
Sergey Beryozkin commented on CXF-3529:
---------------------------------------
Hi, can you explain please what this code means:
+ boolean isbean = false; // TODO:isbean = true if realType is a
Bean
+ Map<String, Object> theValues = new HashMap<String, Object>();
+ if (isbean) {
+
+ } else {
+ Set<Entry<String, String>> entrySet = values.entrySet();
+ for (Entry<String, String> entry : entrySet) {
+ Object o =
InjectionUtils.handleParameter(entry.getValue(),
+ decoded, realType, paramAnns,
pathParam, message);
+ theValues.put(entry.getKey(), o);
+ }
Does it address the case such as
public void method(@FormParam("") User user)
where User looks like this:
public class User {
Map<String, String> k;
}
and a sequence like this is posted:
k.a=1 and k.b=2
> Support for Map Interface in CXF Service and Beans
> --------------------------------------------------
>
> Key: CXF-3529
> URL: https://issues.apache.org/jira/browse/CXF-3529
> Project: CXF
> Issue Type: New Feature
> Components: Core
> Affects Versions: 2.4.1
> Environment: All platforms
> Reporter: Biju Nair
> Labels: java.util.map, map
> Fix For: 2.4.1
>
> Attachments: InjectionUtils.java, InjectionUtils.java,
> InjectionUtils_052511.patch, JAXRSUtils.java, config, cxf-3529.diff
>
> Original Estimate: 96h
> Remaining Estimate: 96h
>
> Apache CXF Rest Services doesn't support java.util.Map interface as their
> service arguments. They even do not support java.util.Map interface inside a
> bean.
> This fix is to support Map interface as arguments and fields inside a bean.
> > The code is tested with sample services like,
> > public String debug(@FormParam("")TestEmployeeTO
> > testObject1,@FormParam("map") Map<String,Integer> map)
> >
> > public class TestEmployeeTO {
> >
> > private HashMap<String,String> currencies;
> >
> > //getters/setters
> > }
> > Input Data
> > map.x=11&map.y=9¤cies.IND=INR¤cies.USA=DOLLAR
> > Output
> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> > map={y=9, x=11}
> >
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira