1

我使用 Per 中的这个示例创建了一个简单的 bean

http://per.lausten.dk/blog/2012/02/creating-your-first-managed-bean-for-xpages.html

我可以使用访问bean

helloWorld.setSomeVariable("test")

使用helloWorld.getSomeVariable()获取值

但是当我使用 EL 语言尝试它时它不起作用 helloWorld.SomeVariable

我收到一个错误,即 SomeVariable 在 helloWorld 中不存在

我可能正在做一些简单的错误,但我看不出是什么。

4

2 回答 2

7

我认为问题在于 EL 可能区分大小写,属性的 bean 样式名称是“someVariable”。Beans 假设您在方法名称中使用驼峰式大小写,因此 EL 将“set”和“get”之后的第一个字母小写以进行翻译。

于 2012-09-18T13:34:54.757 回答
2

在我看来,EL 似乎区分大小写,并且您的属性被定义为 someVariable 而不是 SomeVariable。你试过 helloWorld.someVariable。

于 2012-09-18T13:38:29.467 回答