Where Did the Data Come From?
[Previous] [Main] [Next]

Where did the data for Hale come from?


Here is the login method from the user class.

public String login(){
   // Here we would do login logic and go to an external
   // datastore (i.e. a database)
   if (name.equalsIgnoreCase("Hale")){
      setCity("Altamonte Springs");
      setZip("32714");
      setJavaYear(5);
      GregorianCalendar d1 = new GregorianCalendar(1945,7,24);
      setDob(new java.util.Date(d1.getTime().getTime()));
   } else {
      setCity(null);
      setZip(null);
      setJavaYear(0);
      setDob(null);
   };
   return "login";
}
·When the new page sees components linked to properties that have data, the Faces Servlet automatically runs the getters and fills the components.  
·The "login" string that is returned by this method is used by the Navigation system to decide what page to show next.