我有一个带有 name 的获取参数controller
。当我尝试将它(使用propertyChangeListener
)传递给我的支持 bean 时,我得到null
的不是该参数的实际值:
<h:commandButton value="#{msg['mail.send']}" styleClass="mailbutton" action="#{mailSender.sendMail}">
<f:setPropertyActionListener target="#{mailSender.controllerName}" value="{#param.controller}"/>
</h:commandButton>
所以,我有两个问题:
- 使用获取参数值设置 bean 属性的正确方法是什么?实际上,我已经从中获得了价值,
ExternalContext#getRequestParam
但也许还有其他一些解决方案。 - 更有趣的问题:为什么 propertyActionListener 在这里不起作用?它实际上是做什么的?(我再次对此有一些想法,但最好阅读更全面的解释)。