@ManagedProperty equivalent in Spring
问题 I am using Spring for my DI. Is there an equivalent of @ManagedProperty? I want to inject the value from one view scoped bean into another one on the next page. e.g @Component @Scope("view") public class Page1Bean(){ private String value; } @Component @Scope("view") public class Page2Bean(){ @ManagedProperty(value = #{page1Bean}") //doesnt work in Spring private Page1Bean bean; } 回答1: @Resource or @Autowired should work. @Resource is the Java EE implementation, @Autowired is the spring