Emmachen / SapUi5Test

1 stars 1 forks source link

@ManagedBean #24

Open ghost opened 8 years ago

ghost commented 8 years ago

import javax.annotation.ManagedBean; clipboard1

From this link:

The presence of this annotation on a class automatically registers the class with the runtime as a managed bean class. Classes must be scanned for the presence of this annotation at application startup, before any requests have been serviced.

The ManagedBean annotation marks a POJO (Plain Old Java Object) as a ManagedBean.A ManagedBean supports a small set of basic services such as resource injection, lifecycle callbacks and interceptors. clipboard1

@value

clipboard1

Spring 通过注解获取*.porperties文件的内容,除了xml配置外,还可以通过@value方式来获取。

使用方式必须在当前类使用@Component,xml文件内配置的是通过pakage扫描方式例如:

how Jerry researches on the usage of @value

clipboard1

Perform keyword search: clipboard2

It means in the runtime, the Java variable configurationServerUri will automatically have value "https://api.yaas.io/hybris/configuration/v1" filled by Spring framework.

clipboard1