JSF CommandButton Example

The h:commandButton is used widely in HTML Form Submission. It uses HTTP POST method while submitting the form. It invokes the action or  actionlistener method present in the commandButton tag.


The h:commandButton renders like below in the browser



In this section, I have created an HTML FORM with two input fields and a commandButton.The JSF commandbutton uses action tag to submit the FORM to a managed bean method using HTTP POST


JSF CommandButton Example


Here below is the JSF page contains FORM tag and CommandButton. I used the binding parameter in input fields which binds to managed bean class 



Below is the Managed Bean class 



Below is the Home.xhtml page 



Below is the Navigation Rule present in faces-config.xml 



The JSF page renders like below: 


JSF_CommandButton_Example JSF CommandButton Example


Download Source Code: 


govindan JSF CommandButton Example
Connect me


Thank you for visiting my personal blog. Myself Govindan, Software Developer by profession since 2006 and hence I started this blog early in 2016 and ever since I've been writing about technologies experienced and learnings of everyday life.

The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.

Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂
govindan JSF CommandButton Example
Connect me
By | 2017-11-16T00:23:52+00:00 November 16th, 2017|Categories: JSF|Tags: , , , , |0 Comments
Like us on Facebook.