Xpages、faces-config、托管 bean 和作用域变量 [英] Xpages, faces-config, managed beans, and scoped variables

查看:29
本文介绍了Xpages、faces-config、托管 bean 和作用域变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据库中有一些属性很少会更改,但在整个过程中都普遍使用.似乎这可能是我可以用托管 bean 做的事情?

I have some properties in my database that will rarely if ever change, but are used pervasively throughout. It seems that this might be something I could do with a managed bean?

<managed-bean>
<managed-bean-name>bu</managed-bean-name>
<managed-bean-class>    </managed-bean-class>
<managed-bean-scope>application</managed-bean-scope> </managed-bean>

我想在 applicationScope.bu 中得到一个值列表.

I want to end up with a list of values in applicationScope.bu.

我是否只编写了一个简单的 java 实现?有没有更简单或更好的方法?

Do I just write a simple java implementation? Is there an easier or better way?

推荐答案

如果我正确理解您的问题,我认为托管 bean 的属性不会是您想要存储应用程序属性的地方.

If I understand your question correctly, I don't think the properties of a managed bean would be where you would want to store application properties.

我会将它们粘贴在您的应用程序登录页面上的应用程序范围内.

I would just stick them in application scope on the landing page of your application.

这篇关于Xpages、faces-config、托管 bean 和作用域变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆