What is the difference between setPropertyActionListener vs attribute vs param?
When would use the setPropertyActionListener?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
1. f:setPropertyActionListener:
With this tag, you can directly set property in you backing bean. Example:
xhtml:
backing bean:
This will set
nameproperty of backing bean to value myname.2. f:param:
This tag simple sets the request parameter. Example:
xhtml:
so you can get this parameter in backing bean:
3. f:attribute:
With this tag you can pass attribute so you can grab that attribute from action listener method of your backing bean.
xhtml:
so you can get this attribute from action listener method:
You should use
f:setPropertyActionListenerwhenever you want to set property of the backing bean. If you want to pass parameter to backing bean considerf:paramandf:attribute. Also, it is important to know that withf:paramyou can just passStringvalues, and withf:attributeyou can pass objects.