开发者

upgrading to spring 3.0 problem with interceptorNames

I am trying to upgrade to Spring 3.0 and i have the following issues:

  • Finding the dependencies. People recommend using maven, but id rather not try to learn how to use maven/install it if the jars are available somewhere for download.
  • The following bean declaration is now longer valid but i dont know how to fix it:
<bean id="service"
   class="org.springframework.aop.framework.ProxyFactoryBean">

  <property name="proxyInterfaces" value="com.service.SomeService" /> 
  <property name="target">
        <bean class="com.service.SomeServiceImpl">
        </bean>
  </property>
  <property name="interceptorNames"> 
    <list> 
      <value>hibernateInterceptor</value> 

    </list> 
  </property>
</bean>

The complaint is that <property name="interceptorNames"> is no lon开发者_运维技巧ger supported and should be done some other way


Arr you referring to the following mention in the docs for setInterceptorNames?

NOTE: Specifying a target bean as final name in the "interceptorNames" list is deprecated and will be removed in a future Spring version. Use the "targetName" property instead.

This refers to an odd feature of this property where the last item in the list of interceptors can actually be the intercepted bean itself, rather than being an actual interceptor. This is confusing, though, and discouraged - you're supposed to specify the target using the targetName property.

So interceptorNames is still the way to specify interceptors.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜