186 total views, 5 views today

JSF Form tag Example

 

The JSF form render an HTML Form tag in the browser and it uses HTTP POST method. The CommandButton of type ‘Submit’ help us to submit the Form. The h:form renders in browser like below:

 

JSF => <h:form>

 

HTML => <form id=”j_idt2″ name=”j_idt2″ method=”post” action=”/JSF_FORM_EXAMPLE/faces/index.xhtml” enctype=”application/x-www-form-urlencoded”>

 

 

JSF h:Form Example

 

Below is an index.jsf page contains a <h:fotm>

 

 

The above input component is bound to a backing bean class as shown below; When a user submits the JSF form,  the input component value is available in setter/getter method. 

 

 

JSF h:form Demo: 

 

Below is how the form rendered in a browser; Also notice, It prints the text in the console on submitting the form

 

jsf_form_example JSF Form Tag Example

 

 

govindan JSF Form Tag Example
Connect me

Govind

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 Form Tag Example
Connect me
By | 2017-11-21T01:24:39+00:00 November 21st, 2017|Categories: JSF|Tags: , , , , , |0 Comments
Like us on Facebook.
Connect!