[x] declare the injected beans(UserInfo,Account,ReportInfo) in bean.xml
[x] As an example, initialize value to a bean(UserInfo) declared in bean.xml
[x] declare two beans of same class(UserInfo)
[x] Inject the userinfo to @Controller, Controller implementation class
[x] try to inject bean to the servlet
issues
beans.xml was located in src/spring-config, but it cannot be packed into war during building.
failed to inject bean to servlet by @Configurable
findings
Either annotation @Controller or Interface Control can be used to define the controller class.
The return type of controller can be String(view name),ModelView, Object,or collections。 The annotation @ResponseBody is used to define it as rest api.
create pojo in package osgi.web.beans
inject them in spring xml configuration