Results 1 to 3 of 3

Thread: How to retrieve all derived concret controller?

  1. #1

    Default How to retrieve all derived concret controller?

    I need develop some controllers as below to reflect parent/child relationship. But I don't know if there is any way letting me to have a reference to collection of child controllers from parent controller. After having this reference I can loop through all concrete controllers. Is this a right way to design? What abstract controller should I use? Thanks

    Code:
    <bean id="abstractController" class="mycom.MyAbastractController" abstract="true">
    <!--other property etc-->
      </bean>
    
      <bean id="concreteController1" parent="abstractController">
    <!--other property etc-->
      </bean>
    
      <bean id="concreteController2" parent="abstractController">
    <!--other property etc-->
      </bean>

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    It might be due to the fact that it is already quite late here, but I don't have a clue in what you are trying to achieve here...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Mar 2007
    Posts
    515

    Default

    I'm not sure, either, I understand what you try to achieve.
    If you want to have access to all children of an abstract bean, you can use getBeansOfType method of ListableBeanFactory: http://www.springframework.org/docs/api/org/springframework/beans/factory/ListableBeanFactory.html#getBeansOfType(java.lang. Class)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •