- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试从 JSF 2.0 facelet 调用无参数方法
#{myBean.foo()}
最佳答案
由 this response on the JBoss forum 判断, 方法表达式只能用在支持它们的属性中。
Stan Silvert wrote:
It looks to me like this is working as expected. This has nothing to do with a lack of arguments. Your expression,
#{elManagedBean.hello()}
is being treated as a ValueExpression. If you changed your method togetHello()
then it would work. The question is, should it be treated as aValueExpression
or aMethodExpression
? For instance, if you had the same expression in an action attribute it would be treated as aMethodExpression
.<h:commandButton value="Hello" action="#{elManagedBean.hello()}"
id="submit_button"/>You have put the expression in the middle of the Facelets page and not as the value of an attribute. As far as I know, this will always be treated as a
ValueExpression
. I don't see how this would work in Glassfish. It's possible that there is some code that tries it out as aValueExpression
and then tries it as aMethodExpression
if it fails. However, I think that would go against the EL spec. In other words, I'm surprised that this would work on Glassfish.
关于jsf - JSF 2.0 中不带参数的 MethodExpression 调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7345417/
我不确定在复合组件中处理方法表达式的“正确”方式。 我的复合 Material 使用带有操作方法的支持类。这些执行一些默认操作或委托(delegate)给复合用户作为属性传递的操作方法: 在使用页面中
我有一个带有 MethodExpression 属性的 UI 组件 changeListener : .. .. 此 changeListener属性是一个可选的方法表达式
这个图表显示得很好,但日志一点也不好看。 我找不到异常的原因。任何建议表示赞赏!我相信在两种情况下,没有实例,因为它没有被调用,或者我在我的 bean 中得到一个空指针。但我已经在 bean 中完成了
我正在尝试从 JSF 2.0 facelet 调用无参数方法 #{myBean.foo()} (没有任何周围的标签)。 根据 Burns/Schalk: The Complete Reference:
我有一个 jsp 标签,它以 javax.el.MethodExpression 作为属性: 在我拥有的同一个标签中: link text 当我尝试点击链接时出现以下错误: javax.
我是一名优秀的程序员,十分优秀!