Passing data between managed components in JSF

后端 未结 2 1051
遇见更好的自我
遇见更好的自我 2020-12-09 13:05

Is it actually possible to pass any data between managed components in JSF? If yes, how to achieve this?

Could anyone provide any sample?

2条回答
  •  一个人的身影
    2020-12-09 13:19

    To add to BalusC's answer, if you are using a dependency-injection framework (spring, guice, etc.), or if using JSF 2.0, you can have one managed bean set into the other using just:

    @Inject
    private Bean2 bean2;
    

    (or the appropriate annotation based on your DI framework)

提交回复
热议问题