b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

bayeaux tapestry_tapestry5_nature tapestry衣服(2)

电脑杂谈  发布时间:2017-02-12 16:03:40  来源:网络整理

If you have configured Spring to allow annotation-based injection, then you will be able to inject Tapestry services into your Spring Beans.

This feature is only available when Spring ApplicationContext is not configured and loaded externally.

Inside your Spring beans, you may use @Inject and @Autowired annotations.

Simply add these two annotations on top the field you want to inject in your Spring bean.
{code:language=java}
    @Inject
    @Autowired
    private MyService myService;
{code}

or use @Inject on top of arguments in @Autowired bean constructor methods
{code:language=java}
    private final MyService myService;
    @Autowired
    public UserDAOImpl(@Inject MyService myService)
    {
      this.myService = myService;
    }
{code}
h3. Configuring Spring with Tapestry Symbols

This is accomplished by a BeanFactoryPostProcessors that resolves the values of 'placeholders' from symbol values. In the following example the value of the Bean's property 'productionMode' is the value of the Tapestry's  symbol [tapestry.production-mode|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/SymbolConstants.html#PRODUCTION_MODE]

{code:language=xml}
  <bean id="myBean" class="org.example.MyBean">
    <property name="productionMode" value="${tapestry.production-mode}"/>
  </bean>
{code}

Non-singleton beans are not handled properly. Tapestry will request the beans from the application context in a manner unsuitable for their life cycle. For the moment, you should consider the non-singleton beans to be not injectable. Instead, inject the ApplicationContext service and obtain the non-singleton beans as needed.


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-32014-2.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    • 孟玲
      孟玲

      因为你们检测的根本就不是小米的产品

    热点图片
    拼命载入中...