{"id":1501,"date":"2012-07-20T22:00:00","date_gmt":"2012-07-20T22:00:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/jsf-simple-ajax-samples.html"},"modified":"2012-10-22T05:56:05","modified_gmt":"2012-10-22T05:56:05","slug":"jsf-simple-ajax-samples","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html","title":{"rendered":"JSF Simple Ajax Samples"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\">Today we will see some Simple Samples of Ajax with JSF.<\/p>\n<p>If you want to see other posts about JSF\/Web Applications click on the next links: <a href=\"http:\/\/uaihebert.com\/?p=497\" target=\"_blank\" title=\"JSF Persisting Objects and Messages after a Redirect\">JSF Persisting Objects and Messages after a Redirect<\/a> ,<a href=\"http:\/\/uaihebert.com\/?p=55\" target=\"_blank\" title=\"User Login Validation with JAAS and JSF\">User Login Validation with JAAS and JSF<\/a>, <a href=\"http:\/\/uaihebert.com\/?p=36\" target=\"_blank\" title=\"JSF: Converter and Bean AutoComplete\">JSF: Converter and Bean AutoComplete<\/a>, <a href=\"http:\/\/uaihebert.com\/?p=24\" target=\"_blank\" title=\"JSF \u2013 Hello World, Auto Complete\">JSF \u2013 Hello World, Auto Complete<\/a>, <a href=\"http:\/\/uaihebert.com\/?p=16\" target=\"_blank\" title=\"Handling Exceptions on a WebApp\">Handling Exceptions on a WebApp<\/a>, <a href=\"http:\/\/uaihebert.com\/?p=20\" target=\"_blank\" title=\"User Authentication (Filter\/Servlet)\">User Authentication (Filter\/Servlet)<\/a>, <a href=\"http:\/\/uaihebert.com\/?p=8\" target=\"_blank\" title=\"Creating a WebServer\">Creating a WebServer<\/a>.            <\/p>\n<p>In the end of this post you will find the link to download the source code of the samples. In this post (<a href=\"http:\/\/uaihebert.com\/?p=55\" title=\"User Login Validation with JAAS and JSF\">User Login Validation with JAAS and JSF<\/a>) I show how to install the JBoss 6 in case you want to run the project from today. You will need to install the JBoss tools plugin in your Eclipse.            <\/p>\n<p>Take a look at the page bellow and its code:<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/1.bp.blogspot.com\/-ahg4w-eQ7-I\/UAmjpmR6KLI\/AAAAAAAABBY\/uRs_3YV38yc\/s1600\/01.png\"><img decoding=\"async\" border=\"0\" height=\"187\" src=\"http:\/\/1.bp.blogspot.com\/-ahg4w-eQ7-I\/UAmjpmR6KLI\/AAAAAAAABBY\/uRs_3YV38yc\/s320\/01.png\" width=\"320\" \/><\/a><\/div>\n<pre class=\"brush:java\">&lt;!DOCTYPE html PUBLIC '-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN' 'http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd'&gt;\r\n&lt;html xmlns='http:\/\/www.w3.org\/1999\/xhtml' xmlns:ui='http:\/\/java.sun.com\/jsf\/facelets' xmlns:h='http:\/\/java.sun.com\/jsf\/html'\r\n xmlns:f='http:\/\/java.sun.com\/jsf\/core'&gt;\r\n&lt;h:head&gt;\r\n&lt;\/h:head&gt;\r\n&lt;h:body&gt;\r\n &lt;h:form&gt;\r\n  Your Name: &lt;h:inputText id='inputname' label='${msgs.prompt}' value='#{user.name}'\/&gt;\r\n  &lt;br \/&gt;\r\n  &lt;h:commandButton action='#{user.sayHello}' value='Display my name here, now!'\/&gt;\r\n  &lt;br \/&gt;\r\n &lt;\/h:form&gt;\r\n&lt;\/h:body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>How could we display the typed name in the same screen using Ajax? Piece of cake, just add the \u201cf:ajax\u201d component. Check the code update and the result:<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/2.bp.blogspot.com\/-4A_GMiHSa3E\/UAmjztCgRfI\/AAAAAAAABBg\/UiGCC2fXd60\/s1600\/02+(1).png\"><img decoding=\"async\" border=\"0\" height=\"166\" src=\"http:\/\/2.bp.blogspot.com\/-4A_GMiHSa3E\/UAmjztCgRfI\/AAAAAAAABBg\/UiGCC2fXd60\/s320\/02+(1).png\" width=\"320\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear: both;text-align: center\">\n<\/div>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/3.bp.blogspot.com\/-XVzCMfYy2Eo\/UAmj9qcCRnI\/AAAAAAAABBo\/Ms3cBYY8abQ\/s1600\/03+(1).png\"><img decoding=\"async\" border=\"0\" height=\"288\" src=\"http:\/\/3.bp.blogspot.com\/-XVzCMfYy2Eo\/UAmj9qcCRnI\/AAAAAAAABBo\/Ms3cBYY8abQ\/s320\/03+(1).png\" width=\"320\" \/><\/a><\/div>\n<pre class=\"brush:java\">&lt;!DOCTYPE html PUBLIC '-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN' 'http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd'&gt;\r\n&lt;html xmlns='http:\/\/www.w3.org\/1999\/xhtml' xmlns:ui='http:\/\/java.sun.com\/jsf\/facelets' xmlns:h='http:\/\/java.sun.com\/jsf\/html'\r\n xmlns:f='http:\/\/java.sun.com\/jsf\/core'&gt;\r\n&lt;h:head&gt;\r\n&lt;\/h:head&gt;\r\n&lt;h:body&gt;\r\n &lt;h:form&gt;\r\n  Your Name: &lt;h:inputText id='inputname' label='${msgs.prompt}' value='#{user.name}'\/&gt;\r\n  &lt;br \/&gt;\r\n  &lt;h:commandButton action='#{user.sayHello}' value='Display my name here, now!'&gt;\r\n   &lt;f:ajax render='myName' execute='inputname' \/&gt;\r\n  &lt;\/h:commandButton&gt;\r\n  &lt;br \/&gt;\r\n  &lt;br \/&gt;\r\n  &lt;h:outputText id='myName' value='#{user.name}' \/&gt;\r\n &lt;\/h:form&gt;\r\n&lt;\/h:body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>It is very easy right? We just need to pass the value that will be carried to the ManagedBean by the \u201cexecute\u201d parameter; with the \u201crender\u201d parameter we will tell to the JSF which component will be \u201crefreshed\u201d.            <\/p>\n<p>Notice also that the typed name appears in the Console.            <\/p>\n<p>With this code we can \u201crefresh\u201d all kind of components. Let us see another sample?            <\/p>\n<p>Let us display an error message if the user types a name with less than 4 characters.            <\/p>\n<p>Check our new message and the new code:<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/3.bp.blogspot.com\/-gW8jWS_34Sk\/UAmkF5YT3KI\/AAAAAAAABBw\/iQOlnWCeU58\/s1600\/04+(1).png\"><img decoding=\"async\" border=\"0\" height=\"221\" src=\"http:\/\/3.bp.blogspot.com\/-gW8jWS_34Sk\/UAmkF5YT3KI\/AAAAAAAABBw\/iQOlnWCeU58\/s320\/04+(1).png\" width=\"320\" \/><\/a><\/div>\n<pre class=\"brush:java\">&lt;!DOCTYPE html PUBLIC '-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN' 'http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd'&gt;\r\n&lt;html xmlns='http:\/\/www.w3.org\/1999\/xhtml' xmlns:ui='http:\/\/java.sun.com\/jsf\/facelets' xmlns:h='http:\/\/java.sun.com\/jsf\/html'\r\n xmlns:f='http:\/\/java.sun.com\/jsf\/core'&gt;\r\n&lt;h:head&gt;\r\n&lt;\/h:head&gt;\r\n&lt;h:body&gt;\r\n &lt;h:form&gt;\r\n  &lt;h:messages id='myMessage' globalOnly='true' showDetail='true'\/&gt;\r\n  Your Name: &lt;h:inputText id='inputname' label='${msgs.prompt}' value='#{user.name}'\/&gt;\r\n  &lt;br \/&gt;\r\n  &lt;h:commandButton action='#{user.sayHello}' value='Display my name here, now!'&gt;\r\n   &lt;f:ajax render='myName myMessage' execute='inputname' \/&gt;\r\n  &lt;\/h:commandButton&gt;\r\n  &lt;br \/&gt;\r\n  &lt;br \/&gt;\r\n  &lt;h:outputText id='myName' value='#{user.name}' \/&gt;\r\n &lt;\/h:form&gt;\r\n&lt;\/h:body&gt;\r\n&lt;\/html&gt;<\/pre>\n<pre class=\"brush:java\">package demo;\r\n\r\nimport javax.faces.application.FacesMessage;\r\nimport javax.faces.bean.ManagedBean;\r\nimport javax.faces.bean.RequestScoped;\r\nimport javax.faces.context.FacesContext;\r\n\r\n\/**\r\n * Created by JBoss Tools\r\n *\/\r\n@ManagedBean(name = 'user')\r\n@RequestScoped\r\npublic class User {\r\n\r\n private String name;\r\n\r\n public String sayHello() {\r\n  if (isNameIncorrect()) {\r\n   FacesContext context = FacesContext.getCurrentInstance();\r\n   context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, 'Too small', 'Can you write it a little bigger?'));\r\n  }\r\n\r\n  System.out.println(name);\r\n  return null;\r\n }\r\n\r\n private boolean isNameIncorrect() {\r\n  return ''.equals(name.trim()) || name.length() &lt; 3;\r\n }\r\n\r\n public String getName() {\r\n  return name;\r\n }\r\n\r\n public void setName(String name) {\r\n  this.name = name;\r\n }\r\n}<\/pre>\n<p>Notice that we have the component \u201ch:messages\u201d and its ID is used in the \u201cf:ajax\u201d component. This code also works when you use the \u201c<em>h:message for=\u201cYYY\u201d<\/em>\u201d component.            <div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>What if we work now with comboboxes? Let us display a combobox that will contain 4 items when we have a name with less than 6 characters, and a list with more than 4 items if the typed name has more than 6 characters.            <\/p>\n<pre class=\"brush:java\">package demo;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\nimport javax.faces.application.FacesMessage;\r\nimport javax.faces.bean.ManagedBean;\r\nimport javax.faces.bean.RequestScoped;\r\nimport javax.faces.component.UISelectItems;\r\nimport javax.faces.component.html.HtmlSelectOneMenu;\r\nimport javax.faces.context.FacesContext;\r\nimport javax.faces.event.AjaxBehaviorEvent;\r\n\r\n\/**\r\n * Created by JBoss Tools\r\n *\/\r\n@ManagedBean(name = 'user')\r\n@RequestScoped\r\npublic class User {\r\n\r\n private String name;\r\n\r\n private List&lt;String&gt; cars;\r\n\r\n private String selectedCar;\r\n private HtmlSelectOneMenu htmlSelectCars;\r\n\r\n private static final String SELECT_A_CAR = 'Select One Car';\r\n\r\n public User() {\r\n  cars = new ArrayList&lt;String&gt;();\r\n }\r\n\r\n public String sayHello() {\r\n  if (isNameInCorrect()) {\r\n   FacesContext context = FacesContext.getCurrentInstance();\r\n   context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, 'Too small', 'Can you write it a little bigger?'));\r\n  }\r\n\r\n  System.out.println(name);\r\n  return null;\r\n }\r\n\r\n private boolean isNameInCorrect() {\r\n  return name == null || ''.equals(name.trim()) || name.length() &lt; 3;\r\n }\r\n\r\n public String getName() {\r\n  return name;\r\n }\r\n\r\n public void setName(String name) {\r\n  this.name = name;\r\n }\r\n\r\n public void editMyCarsList(AjaxBehaviorEvent event) {\r\n  if (htmlSelectCars == null) {\r\n   htmlSelectCars = new HtmlSelectOneMenu();\r\n  }\r\n\r\n  htmlSelectCars.getChildren().clear();\r\n\r\n  UISelectItems items = new UISelectItems();\r\n  items.setValue(getCars());\r\n  htmlSelectCars.getChildren().add(items);\r\n }\r\n\r\n public List&lt;String&gt; getCars() {\r\n  cars.clear();\r\n\r\n  cars.add(SELECT_A_CAR);\r\n\r\n  if (!isNameInCorrect() &amp;&amp; name.length() &gt;= 6) {\r\n   cars.add('Ferrari');\r\n   cars.add('Porch');\r\n   cars.add('Beetle');\r\n   cars.add('Opala');\r\n   cars.add('Passat');\r\n   cars.add('Vectra');\r\n   cars.add('Chevet');\r\n   cars.add('Corvet');\r\n  } else {\r\n   cars.add('Ferrari');\r\n   cars.add('Porch');\r\n   cars.add('Beetle');\r\n   cars.add('Opala');\r\n  }\r\n\r\n  return cars;\r\n }\r\n\r\n public void setCars(List&lt;String&gt; cars) {\r\n  this.cars = cars;\r\n }\r\n\r\n public String getSelectedCar() {\r\n  return selectedCar;\r\n }\r\n\r\n public void setSelectedCar(String selectedCar) {\r\n  this.selectedCar = selectedCar;\r\n }\r\n\r\n public HtmlSelectOneMenu getHtmlSelectCars() {\r\n  editMyCarsList(null);\r\n\r\n  return htmlSelectCars;\r\n }\r\n\r\n public void setHtmlSelectCars(HtmlSelectOneMenu htmlSelectCars) {\r\n  this.htmlSelectCars = htmlSelectCars;\r\n }\r\n}<\/pre>\n<p>Take a look now at our page:<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/2.bp.blogspot.com\/-3xtYPjaFHo0\/UAmkQuOKfRI\/AAAAAAAABB4\/JtMzxBY0pdk\/s1600\/05+(1).png\"><img decoding=\"async\" border=\"0\" height=\"292\" src=\"http:\/\/2.bp.blogspot.com\/-3xtYPjaFHo0\/UAmkQuOKfRI\/AAAAAAAABB4\/JtMzxBY0pdk\/s320\/05+(1).png\" width=\"320\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/1.bp.blogspot.com\/-wg4eMJqO6wQ\/UAmkaQWTC8I\/AAAAAAAABCA\/JTW02FLteVw\/s1600\/06+(1).png\"><img decoding=\"async\" border=\"0\" height=\"320\" src=\"http:\/\/1.bp.blogspot.com\/-wg4eMJqO6wQ\/UAmkaQWTC8I\/AAAAAAAABCA\/JTW02FLteVw\/s320\/06+(1).png\" width=\"241\" \/><\/a><\/div>\n<pre class=\"brush:java\">&lt;!DOCTYPE html PUBLIC '-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN' 'http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd'&gt;\r\n&lt;html xmlns='http:\/\/www.w3.org\/1999\/xhtml' xmlns:ui='http:\/\/java.sun.com\/jsf\/facelets' xmlns:h='http:\/\/java.sun.com\/jsf\/html'\r\n xmlns:f='http:\/\/java.sun.com\/jsf\/core'&gt;\r\n&lt;h:head&gt;\r\n&lt;\/h:head&gt;\r\n&lt;h:body&gt;\r\n &lt;h:form&gt;\r\n  &lt;h:messages id='myMessage' globalOnly='true' showDetail='true' \/&gt;\r\n  Your Name: &lt;h:inputText id='inputname' label='${msgs.prompt}' value='#{user.name}' \/&gt;\r\n  &lt;br \/&gt;\r\n  &lt;h:commandButton action='#{user.sayHello}' value='Display my name here, now!'&gt;\r\n   &lt;f:ajax render='myName myCars myMessage' execute='inputname' listener='#{user.editMyCarsList}' \/&gt;\r\n  &lt;\/h:commandButton&gt;\r\n  &lt;br \/&gt;\r\n  &lt;br \/&gt;\r\n  &lt;h:outputText id='myName' value='#{user.name}' \/&gt;\r\n  &lt;br \/&gt;\r\n  &lt;br \/&gt;\r\n  Choose your car: &lt;h:selectOneMenu id='myCars' binding='#{user.htmlSelectCars}' value='#{user.selectedCar}' \/&gt;\r\n  &lt;br \/&gt;\r\n  &lt;br \/&gt;\r\n &lt;\/h:form&gt;\r\n&lt;\/h:body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>Notice that our combobox items size is updated according to the typed name. At the end of this post I will talk more about why I used the binding attribute to the HtmlSelectOneMenu instead returning the List&lt;String&gt;.            <\/p>\n<p>As our last sample, let us create a combobox that will appear and disappear according to the selected value in the Car combobox.            <\/p>\n<p>Take a look at our ManagedBean:            <\/p>\n<pre class=\"brush:java\">package demo;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\nimport javax.faces.application.FacesMessage;\r\nimport javax.faces.bean.ManagedBean;\r\nimport javax.faces.bean.RequestScoped;\r\nimport javax.faces.component.UISelectItems;\r\nimport javax.faces.component.html.HtmlSelectOneMenu;\r\nimport javax.faces.context.FacesContext;\r\nimport javax.faces.event.AjaxBehaviorEvent;\r\n\r\n\/**\r\n * Created by JBoss Tools\r\n *\/\r\n@ManagedBean(name = 'user')\r\n@RequestScoped\r\npublic class User {\r\n\r\n private String name;\r\n\r\n private List&lt;String&gt; cars;\r\n private List&lt;String&gt; colors;\r\n\r\n private String selectedCar;\r\n private String selectedColor;\r\n private HtmlSelectOneMenu htmlSelectCars;\r\n\r\n private static final String SELECT_A_CAR = 'Select One Car';\r\n\r\n public User() {\r\n  cars = new ArrayList&lt;String&gt;();\r\n  colors = new ArrayList&lt;String&gt;();\r\n\r\n  colors.add('Red');\r\n  colors.add('Blue');\r\n  colors.add('Orange');\r\n  colors.add('Pink --&gt; O.o');\r\n }\r\n\r\n public String sayHello() {\r\n  if (isNameInCorrect()) {\r\n   FacesContext context = FacesContext.getCurrentInstance();\r\n   context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, 'Too small', 'Can you write it a little bigger?'));\r\n  }\r\n\r\n  System.out.println(name);\r\n  return null;\r\n }\r\n\r\n private boolean isNameInCorrect() {\r\n  return name == null || ''.equals(name.trim()) || name.length() &lt; 3;\r\n }\r\n\r\n public String getName() {\r\n  return name;\r\n }\r\n\r\n public void setName(String name) {\r\n  this.name = name;\r\n }\r\n\r\n public void editMyCarsList(AjaxBehaviorEvent event) {\r\n  if (htmlSelectCars == null) {\r\n   htmlSelectCars = new HtmlSelectOneMenu();\r\n  }\r\n\r\n  htmlSelectCars.getChildren().clear();\r\n\r\n  UISelectItems items = new UISelectItems();\r\n  items.setValue(getCars());\r\n  htmlSelectCars.getChildren().add(items);\r\n }\r\n\r\n public List&lt;String&gt; getCars() {\r\n  cars.clear();\r\n\r\n  cars.add(SELECT_A_CAR);\r\n\r\n  if (!isNameInCorrect() &amp;&amp; name.length() &gt;= 6) {\r\n   cars.add('Ferrari');\r\n   cars.add('Porch');\r\n   cars.add('Beetle');\r\n   cars.add('Opala');\r\n   cars.add('Passat');\r\n   cars.add('Vectra');\r\n   cars.add('Chevet');\r\n   cars.add('Corvet');\r\n  } else {\r\n   cars.add('Ferrari');\r\n   cars.add('Porch');\r\n   cars.add('Beetle');\r\n   cars.add('Opala');\r\n  }\r\n\r\n  return cars;\r\n }\r\n\r\n public void setCars(List&lt;String&gt; cars) {\r\n  this.cars = cars;\r\n }\r\n\r\n public String getSelectedCar() {\r\n  return selectedCar;\r\n }\r\n\r\n public void setSelectedCar(String selectedCar) {\r\n  this.selectedCar = selectedCar;\r\n }\r\n\r\n public List&lt;String&gt; getColors() {\r\n  return colors;\r\n }\r\n\r\n public void setColors(List&lt;String&gt; colors) {\r\n  this.colors = colors;\r\n }\r\n\r\n public boolean isColorsAlloweToDisplay() {\r\n  if (isNameInCorrect()) {\r\n   return false;\r\n  }\r\n\r\n  if (selectedCar == null || selectedCar.trim().equals('') || selectedCar.equals(SELECT_A_CAR)) {\r\n   return false;\r\n  }\r\n\r\n  return true;\r\n }\r\n\r\n public String getSelectedColor() {\r\n  return selectedColor;\r\n }\r\n\r\n public void setSelectedColor(String selectedColor) {\r\n  this.selectedColor = selectedColor;\r\n }\r\n\r\n public HtmlSelectOneMenu getHtmlSelectCars() {\r\n  editMyCarsList(null);\r\n\r\n  return htmlSelectCars;\r\n }\r\n\r\n public void setHtmlSelectCars(HtmlSelectOneMenu htmlSelectCars) {\r\n  this.htmlSelectCars = htmlSelectCars;\r\n }\r\n}<\/pre>\n<p>Our ManagedBean were lightly updated, we just added a List with a method that return a list of colors that will populate our combobox; we added also a method that will return a Boolean \u2013 true if the combobox is allowed to be displayed.            <\/p>\n<p>Check our new page:<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/2.bp.blogspot.com\/-8rBj6G-kKQg\/UAmklNB8kxI\/AAAAAAAABCI\/W5o7BYXfB8s\/s1600\/07+(1).png\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/2.bp.blogspot.com\/-8rBj6G-kKQg\/UAmklNB8kxI\/AAAAAAAABCI\/W5o7BYXfB8s\/s1600\/07+(1).png\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/1.bp.blogspot.com\/-fRRrQsiCyn4\/UAmktTJlaHI\/AAAAAAAABCQ\/cNJN42kxT78\/s1600\/08+(1).png\"><img decoding=\"async\" border=\"0\" height=\"273\" src=\"http:\/\/1.bp.blogspot.com\/-fRRrQsiCyn4\/UAmktTJlaHI\/AAAAAAAABCQ\/cNJN42kxT78\/s320\/08+(1).png\" width=\"320\" \/><\/a><\/div>\n<pre class=\"brush:java\">&lt;!DOCTYPE html PUBLIC '-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN' 'http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd'&gt;\r\n&lt;html xmlns='http:\/\/www.w3.org\/1999\/xhtml' xmlns:ui='http:\/\/java.sun.com\/jsf\/facelets' xmlns:h='http:\/\/java.sun.com\/jsf\/html'\r\n xmlns:f='http:\/\/java.sun.com\/jsf\/core'&gt;\r\n&lt;h:head&gt;\r\n&lt;\/h:head&gt;\r\n&lt;h:body&gt;\r\n &lt;h:form&gt;\r\n  &lt;h:messages id='myMessage' globalOnly='true' showDetail='true' \/&gt;\r\n  Your Name: &lt;h:inputText id='inputname' label='${msgs.prompt}' value='#{user.name}' \/&gt;\r\n  &lt;br \/&gt;\r\n  &lt;h:commandButton action='#{user.sayHello}' value='Display my name here, now!'&gt;\r\n   &lt;f:ajax render='myName myCars myMessage myColors' execute='inputname' listener='#{user.editMyCarsList}' \/&gt;\r\n  &lt;\/h:commandButton&gt;\r\n  &lt;br \/&gt;\r\n  &lt;br \/&gt;\r\n  &lt;h:outputText id='myName' value='#{user.name}' \/&gt;\r\n  &lt;br \/&gt;\r\n  &lt;br \/&gt;\r\n  Choose your car:\r\n  &lt;h:selectOneMenu id='myCars' binding='#{user.htmlSelectCars}' value='#{user.selectedCar}'&gt;\r\n   &lt;f:ajax render='myColors' execute='inputname myCars'\/&gt;\r\n  &lt;\/h:selectOneMenu&gt;\r\n  &lt;br \/&gt;\r\n  &lt;br \/&gt;\r\n  &lt;h:panelGroup id='myColors'&gt;\r\n   &lt;h:selectOneMenu value='#{user.selectedColor}' rendered='#{user.colorsAlloweToDisplay}'&gt;\r\n    &lt;f:selectItems value='#{user.colors}' \/&gt;\r\n   &lt;\/h:selectOneMenu&gt;\r\n  &lt;\/h:panelGroup&gt;\r\n &lt;\/h:form&gt;\r\n &lt;\/h:body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>I will talk about the code used in the post:            <\/p>\n<ul>\n<li>HtmlSelectOneMenu \u2013 I used the component instead a List because the JSF is not so good in render the components in the user screen (DOM Tree). If your combobox has 4 lines and by using ajax you add more lines to the List, the JSF\/Ajax will not recognize the new added lines; you will be able to use only the older values. You can try to use the code with a List&lt;String&gt; instead using the HtmlSelectOneMenu and see the result; I spend like 3~4 hours to understand this by a lot of searches on the internet.<\/li>\n<li>HtmlSelectOneMenu inside the \u201ch:panelGroup\u201d component \u2013 I did this because every time you want to render a non rendered component you need to update its container. If our selectOne were inside the same form of the car selectOne you would need to render all form.<\/li>\n<\/ul>\n<div>\n<\/div>\n<p><a href=\"https:\/\/sites.google.com\/site\/uaihebertdeposito\/SimpleAjax.rar?attredirects=0&amp;d=1\">Click here to download the code from this post<\/a>.            <\/p>\n<p>I hope this post might help you.            <\/p>\n<p>If you have any question\/doubt\/suggestion just post it.            <\/p>\n<p><strong><i>Reference: <\/i><\/strong><a href=\"http:\/\/uaihebert.com\/?p=666\">JSF Simple Ajax Samples<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Hebert Coelho at the <a href=\"http:\/\/uaihebert.com\/\">uaiHebert<\/a> blog.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today we will see some Simple Samples of Ajax with JSF. If you want to see other posts about JSF\/Web Applications click on the next links: JSF Persisting Objects and Messages after a Redirect ,User Login Validation with JAAS and JSF, JSF: Converter and Bean AutoComplete, JSF \u2013 Hello World, Auto Complete, Handling Exceptions on &hellip;<\/p>\n","protected":false},"author":154,"featured_media":174,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[293],"class_list":["post-1501","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-jsf"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>JSF Simple Ajax Samples - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Today we will see some Simple Samples of Ajax with JSF. If you want to see other posts about JSF\/Web Applications click on the next links: JSF Persisting\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JSF Simple Ajax Samples - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Today we will see some Simple Samples of Ajax with JSF. If you want to see other posts about JSF\/Web Applications click on the next links: JSF Persisting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2012-07-20T22:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-22T05:56:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Hebert Coelho\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/twitter.com\/uaiHebert\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hebert Coelho\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/07\\\/jsf-simple-ajax-samples.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/07\\\/jsf-simple-ajax-samples.html\"},\"author\":{\"name\":\"Hebert Coelho\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/997b72fad4d637a8d56a44ea7938ddf5\"},\"headline\":\"JSF Simple Ajax Samples\",\"datePublished\":\"2012-07-20T22:00:00+00:00\",\"dateModified\":\"2012-10-22T05:56:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/07\\\/jsf-simple-ajax-samples.html\"},\"wordCount\":639,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/07\\\/jsf-simple-ajax-samples.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/jsf-logo.jpg\",\"keywords\":[\"JSF\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/07\\\/jsf-simple-ajax-samples.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/07\\\/jsf-simple-ajax-samples.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/07\\\/jsf-simple-ajax-samples.html\",\"name\":\"JSF Simple Ajax Samples - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/07\\\/jsf-simple-ajax-samples.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/07\\\/jsf-simple-ajax-samples.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/jsf-logo.jpg\",\"datePublished\":\"2012-07-20T22:00:00+00:00\",\"dateModified\":\"2012-10-22T05:56:05+00:00\",\"description\":\"Today we will see some Simple Samples of Ajax with JSF. If you want to see other posts about JSF\\\/Web Applications click on the next links: JSF Persisting\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/07\\\/jsf-simple-ajax-samples.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/07\\\/jsf-simple-ajax-samples.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/07\\\/jsf-simple-ajax-samples.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/jsf-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/jsf-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/07\\\/jsf-simple-ajax-samples.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"JSF Simple Ajax Samples\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/997b72fad4d637a8d56a44ea7938ddf5\",\"name\":\"Hebert Coelho\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g\",\"caption\":\"Hebert Coelho\"},\"description\":\"Senior Java Development, with 4 certifications and a published book about JSF (portuguese only). Founder of the blog uaiHebert.com visited from more than 170 different countries.\",\"sameAs\":[\"http:\\\/\\\/uaihebert.com\\\/\",\"http:\\\/\\\/www.linkedin.com\\\/pub\\\/h%C3%A9bert-coelho-de-oliveira\\\/46\\\/ba8\\\/5bb\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/twitter.com\\\/uaiHebert\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Hebert-Coelho\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JSF Simple Ajax Samples - Java Code Geeks","description":"Today we will see some Simple Samples of Ajax with JSF. If you want to see other posts about JSF\/Web Applications click on the next links: JSF Persisting","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html","og_locale":"en_US","og_type":"article","og_title":"JSF Simple Ajax Samples - Java Code Geeks","og_description":"Today we will see some Simple Samples of Ajax with JSF. If you want to see other posts about JSF\/Web Applications click on the next links: JSF Persisting","og_url":"https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2012-07-20T22:00:00+00:00","article_modified_time":"2012-10-22T05:56:05+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg","type":"image\/jpeg"}],"author":"Hebert Coelho","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/twitter.com\/uaiHebert","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Hebert Coelho","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html"},"author":{"name":"Hebert Coelho","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/997b72fad4d637a8d56a44ea7938ddf5"},"headline":"JSF Simple Ajax Samples","datePublished":"2012-07-20T22:00:00+00:00","dateModified":"2012-10-22T05:56:05+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html"},"wordCount":639,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg","keywords":["JSF"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html","url":"https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html","name":"JSF Simple Ajax Samples - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg","datePublished":"2012-07-20T22:00:00+00:00","dateModified":"2012-10-22T05:56:05+00:00","description":"Today we will see some Simple Samples of Ajax with JSF. If you want to see other posts about JSF\/Web Applications click on the next links: JSF Persisting","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2012\/07\/jsf-simple-ajax-samples.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"JSF Simple Ajax Samples"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/997b72fad4d637a8d56a44ea7938ddf5","name":"Hebert Coelho","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g","caption":"Hebert Coelho"},"description":"Senior Java Development, with 4 certifications and a published book about JSF (portuguese only). Founder of the blog uaiHebert.com visited from more than 170 different countries.","sameAs":["http:\/\/uaihebert.com\/","http:\/\/www.linkedin.com\/pub\/h%C3%A9bert-coelho-de-oliveira\/46\/ba8\/5bb","https:\/\/x.com\/http:\/\/twitter.com\/uaiHebert"],"url":"https:\/\/www.javacodegeeks.com\/author\/Hebert-Coelho"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/154"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=1501"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1501\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/174"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=1501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=1501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=1501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}