xml - spring MapFactoryBean return map of map instead of creating map -
i map inside map using spring beans in xml doing next : goal have map> mobilemap wrapper when use mobilemap.get("mobilemap") requested without wrapper xml :
<bean class="org.springframework.beans.factory.config.mapfactorybean" id="mobilemap1111"> <property name="targetmapclass"> <value>java.util.hashmap</value> </property> <property name="sourcemap"> <map> <entry key="cfnetwork/221.5"> <bean class="org.springframework.beans.factory.config.mapfactorybean"> <property name="targetmapclass"> <value>java.util.hashmap</value> </property> <property name="sourcemap"> <map> <entry key="9.2.0"> <bean class="com.betamedia.tp.api.model.useragentinfo"> <property name="browser" value="darwin" /> <property name="ismobile" value="true" /> <property name="browserversion" value="9.2.0" /> <property name="operatingsystem" value="mac os x " /> <property name="operatingsystemversion" value="10.5.2" /> </bean> </entry> </map> </property> </bean> </entry> <entry key="cfnetwork/596.4.3"> <bean class="org.springframework.beans.factory.config.mapfactorybean"> <property name="targetmapclass"> <value>java.util.hashmap</value> </property> <property name="sourcemap"> <map> <entry key="12.4.0"> <bean class="com.betamedia.tp.api.model.useragentinfo"> <property name="browser" value="darwin" /> <property name="ismobile" value="true" /> <property name="browserversion" value="12.4.0" /> <property name="operatingsystem" value="mac os x " /> <property name="operatingsystemversion" value="10.8.4" /> </bean> </entry> </map> </property> </bean> </entry> </map> </property> </bean>
but keep on getting in autuwired field : map of map of map , have :
@autowired protected map<string, map<string, map<string, useragentinfo>>> mobilemap;
instead of
@autowired protected map<string, map<string, useragentinfo>> mobilemap;
what doing wrong
instead of using
@autowired protected map<string, map<string, map<string, useragentinfo>>> mobilemap;
i should have used
@resource(name = "mobileuseragentmap") protected map<string, map<string, useragentinfo>> mobileuseragentmap;
Comments
Post a Comment