荷一居茶生活

关注

how to inject <class> type in spring

荷一居茶生活

关注

阅读 55

2023-04-19


 

 

sample:

Class itemClass;

public Class getItemClass() {
return itemClass
}


public void setItemClass(Class itemClass) {
this.itemClass = itemClass;
}

 

Now inject itemClass property in spring:



<bean id="shampoo" class="com.test.Product">
<property name="itemClass">
<value type="java.lang.Class">com.myproducts.Shampoo</value>
</property>
</bean>


  

    it should work.

 

相关推荐

夕颜合欢落

Spring Boot MongoDB How to remove _class from spring data mongodb collection

夕颜合欢落 67 0 0

斗米

SpringMVC: spring mvc No converter found for return value of type: class

斗米 94 0 0

waaagh

python type class object关系

waaagh 25 0 0

四月天2021

Type 和 class 的区别

四月天2021 69 0 0

早安地球

【error】no type named ‘type’ in ‘class std::result_of<void

早安地球 100 0 0

凶猛的小白兔

hdu2577 How to Type---DP

凶猛的小白兔 55 0 0

慕犹清

动态规划——How to Type(hdu2577)

慕犹清 64 0 0

janedaring

杭电ACM HDU 2577 How to Type

janedaring 63 0 0

雨鸣静声

llocating an object of abstract class type "xxxx"

雨鸣静声 13 0 0

快乐与微笑的淘气

【Android,Kotlin】No type arguments expected for class Call

快乐与微笑的淘气 62 0 0

精彩评论(0)

0 0 举报