Hello All,
a quick question.
i have a class which holds a hashmap.
@Component
public class PhotoTypeMapper {
private Map<
String,String> photoTypeMap;
}
In the spring config i initilize the map
<bean id="photoTypeMapper" class="com.XXX.services.PhotoTypeMapper">
<property name="photoTypeMap">
<map>
<entry key="TDS">
<value>Exterior</value>
</entry>
<entry key="ETS">
<value>Exterior</value>
</entry>
<entry key="INP">
<value>Interior</value>
</entry>
</map>
</property>
</bean>
i have a regular class for example
Test this and this is just a regular class how can i autowire my mapper class in this i tried.
class Test{
@Autowired
private PhotoTypeMapper photoTypeMapper;
}
when i check i get photoTypeMapper as null since the class Test is not a spring bean.
Any shortcuts how to achive this, i can always use the ClassPathApplicationContext and manullay get the bean just is there a way to autowire it.
Thanks
darniz