How to pass get-parameter to backing bean in jsf?
Posted
by Roman
on Stack Overflow
See other posts from Stack Overflow
or by Roman
Published on 2010-03-29T16:09:05Z
Indexed on
2010/03/29
16:13 UTC
Read the original article
Hit count: 392
I have get parameter with name controller
. When I try to pass it (with propertyChangeListener
) to my backing bean I get null
instead of the real value of the parameter:
<h:commandButton value="#{msg['mail.send']}" styleClass="mailbutton" action="#{mailSender.sendMail}">
<f:setPropertyActionListener target="#{mailSender.controllerName}" value="{#param.controller}"/>
</h:commandButton>
So, I have two questions:
- What is the proper way to set bean property with a get-parameter value?
Actually, I've already get the value from
ExternalContext#getRequestParam
but maybe there are some other solutions. - More interesting question: why propertyActionListener didn't work here? What does it do actually? (again I have some thoughts about it but it would be nice to read more comprehensive explanations).
© Stack Overflow or respective owner