How to create a Spring Bean of a Inner class?

前端 未结 1 662
闹比i
闹比i 2021-01-01 11:14

I would like to create a Spring Bean of a Inner class. If I have the following inner class B:

package x.y.z;

public class A {
    public class          


        
相关标签:
1条回答
  • 2021-01-01 11:39

    You cannot access your public static inner class with the dot (.) notation, instead, use the currency ($). An example:

    <bean class="x.y.z.A$B" name="innerBean" />
    

    This will work.

    0 讨论(0)
提交回复
热议问题