Search code examples
jsfapache-axis

why Jsf can't access Axis2 Generated ADBBean field?


I was Using JSF With EJB using RMI and it was working fine i.e. all the entities that were being used at the EJB had a sekelton on the JSF and in the xhtml i could access its field easily Below is a sample Code

 @ManagedBean("abc")
    @SessionScoped
    public class ABC{

        private Customer customer;
        public Customer getCustomer(){
        return customer;
        }

       public void setCustomer(Customer customer){
       this.customer=customer;
       }

       }

    //Entity Class Customer
    Public class Customer implements Serializable{

    private String name;

    public String getName(){
    return name;
    }
    public void setName(String name){
    this.name=name;


       }

    }

And in the XHTML pages I could use Like:

<input value="#{abc.customer.name}"/>

As you can see above that I am accessing its direct field therefore it can access both the getter and setter automatically

But Now I haved changed to the Webservices using Axis2 client Generation and they have their own generated skeleton of entities of the EJB

below is a sample:

@ManagedBean("abc")
    @SessionScoped
    public class ABC{

    private WebClientStub.Customer customer;

    public Customer getCustomer(){
            return customer;
            }

    public void setCustomer(WebClientStub.Customer customer){
           this.customer=customer;
    }



    }

    //Entity Class Customer
    Public class Customer implements org.apache.axis2.databinding.ADBBean{

    protected String localName;

    public String getName(){
    return localName;
    }
    public void setName(java.lang.String name){
    this.localName=name;
       }
    }

and In the JSF I can't access the name Like I was accessing it before

<input value="#{abc.customer.localName}"/>

Instead I can only access its getter or Setter, Can any One explain why, or come Up with a solution


Solution

  • The problem was solved, the autogenerated classes had a different Variable name now i.e. 'localName' in my case and therefore I changed this in the JSF input text box as well(as you can see in the question) the error that was coming was that the 'property was not found' against the localName and I thought the auto-generated getter/setter i.e. getName() and setName() were there i renamed them to getLocalName() and setLocalName() then it worked, hence it turned out JSF only lookes for the getter setter and don't care about the property is declared or not.