0

I have a JSF 2.0 app that runs on multiple domains and serves up different content based on the domain running. I have a table in the database that contains the domain names, along with an id. I have a header and footer bean and want to be able to access the domain id in both these beans, but I only want to retrieve the domain id once. Should I create a common bean? If so, how do I ensure this bean is executed when the session starts? How do I access the domain id in the common bean from the header and footer bean?

4

1 回答 1

1

您应该将您的公共 bean 创建为@SessionScopedbean 并在其他 bean 中使用它的实例。

于 2013-09-27T05:39:11.387 回答