Announcement Announcement Module
No announcement yet.
"target property" or "last entry in intercept Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • "target property" or "last entry in intercept


    I put the bean to be proxied in the [email protected]="target", and set a [email protected]="singleton" to true for ProxyFactoryBean. This gives me an exception saying that name is null when refreshing target. I found that the exception is thrown in the method refreshTarget().

    after reading the src, I found that when using "prototype" (singleton=false), ProxyFactoryBean expects the targetsource to be appended as the last entry in interceptorNames, and not in the "target" property. Is this the desired behaviour? using the "target" property alone works fine if I set singleton to true.


    Zehua Liu

  • #2
    Yes, this is normal behaviour. In the case of a prototype, the config needs to specify the bean name of the target, rather than have a reference, as the target instance will vary each time, and results from a BeanFactory lookup performed when a proxy is created by ProxyFactoryBean.