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

  • "target property" or "last entry in intercept

    Hi,

    I put the bean to be proxied in the property@name="target", and set a property@name="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.

    Thanks..

    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.

    Comment

    Working...
    X