• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to access the gettr/setter method of embeded object inside the form bean.

 
prithvi s zankat
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have used object as a member variable in my form bean. I want to
access that member object's method using <bean:write/read>. Is is possible? How if it is.
 
Dom Lassy
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<bean:write name="MyForm" property="myObject.myMethod"/>

public class MyForm extends ActionForm {
MyObject myObject();

public MyObject getMyObject() {
return this.myObject;
}
}

public class MyObject {
public String getMyMethod() {
return "Hello World.";
}
}

The "code" above is an example and hasn't been compiled.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!