cancel
Showing results for 
Search instead for 
Did you mean: 

Access from jsf to hierarchy classes

rrobles
Champ in-the-making
Champ in-the-making
Hello,

    I have a new class that extends of a alfresco's class, is it possible access to the properties of parents class from jsp?

for example,
  it existis a class of alfresco, for example AlfrescoClass
 

class AlfrescoClass {
  protected String test = new String("Test");
  public String getTest() {
   return this.test;
  }
   
  public void setName(String Test) {
   this.example = Text;
  }

}
 

I create a new class Example and extends of a class from Alfresco, for example AlfrescoClass

class Example extends AlfrescoClass{
    protected String name = new String("Name");
    public String getName() {
      return this.name;
    }
   
    public void setName(String name) {
      this.name = name;
   }
     
}
  

In my jsp   example.jsp, I can access to properties of Example

      <h:outputText value="#{Example.name}" />

But, Can I access to the properties of AlfrescoClass?


      <h:outputText value="#{Example.test}"  />


Thanks
3 REPLIES 3

patil
Champ on-the-rise
Champ on-the-rise
Hi

You can do that. Please refer to JSF bean configuration and accessing the properties from the bean.


Thanks,
Patil
Cignex Technologies
Bangalore

rrobles
Champ in-the-making
Champ in-the-making
The bean would like that

   <bean id="Example" class="com.test.web.bean.Example" >
  </bean>
would I put the properties from parent class?

I test this, but Alfresco doesn't find the properties from parent class neither its methods.
Thanks

rrobles
Champ in-the-making
Champ in-the-making
I have found which was the problem

I have added the manage-bean in faces-config.xml but not in faces-config-custom.xml

Thanks Patil