Change Bean Property : JavaServer Faces « J2EE « Java

Change Bean Property


//This example is from Jakub Czeczotka <jakub.czeczotka>


<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="" 

  Change a property of a simple bean

  <servlet-name>Faces Servlet</servlet-name>

  <servlet-name>Faces Servlet</servlet-name>



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"




package eu.czeczotka;

import java.util.logging.Logger;

 * Simple bean for the ChangeBeanProperty project
 * @author Jakub Czeczotka
public class SimpleBean {
    private Logger logger = Logger.getLogger ("eu.czeczotka.SimpleBean");
    private String property = "initial value";
    public String getProperty () {
    public void setProperty (String property) { ("changing property value from \"" + + "\" to \"" + property + "\""); = property;


<% response.sendRedirect("changeBeanProperty.jsf"); %>


<%@ taglib uri="" prefix="f" %>
<%@ taglib uri="" prefix="h" %>

<%-- ChangeBeanProperty - author Jakub Czeczotka --%>

      <h3>Change a property of a simple bean</h3><br />
      <h:inputText value="#{}" />
      <h:commandButton type="submit" value="change value" action="#" />

  2,264 k)

Related examples in the same category

1.Hello World JSF
2.JavaServer Faces
3.jsf jpa war
4.Gathers all select items from specified component's children
5.Converts UISelectMany submitted value to converted value
6.Simple utility class for CSS style formatting
7.Common static utility methods that help in implementing JSF tags
8.Jsf Utility