FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



Oct 25, 2011, 6:04 PM
57 Posts

Re: Difference between property configuration in face-config.xml/.xsp property file and class constructor

  • Category: APIs
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: faces-config.xml
  • Replies: 4
Lets take an example
Java Class:
public class Person{
    public String Name;
 
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
 
   public Person(){
   } 
 
   public Person(String name) {
        super();
        this.name = name;
   }
 
}
 
Java class in property file
<managed-bean>
  <managed-bean-name>Person</managed-bean-name>
  <managed-bean-class>com.something</managed-bean-class>
  <managed-bean-scope>request</managed-bean-scope>                                             
  <managed-property>
    <property-name>Name</property-name>
    <value>Thomas</value>
  </managed-property> 
<managed-bean>
 
both Java constructor and class definition in property file will create a class instance with default Name, is there any advantage doing it in property file? Difference in Object lifecycle, I suppose that class instance is created before rendering for property configuration ? Because of the empty constructor ?
http://www.oracle.com/technetwork/topics/index-101145.html


FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.