This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes How to access the gettr/setter method of embeded object inside the form bean. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to access the gettr/setter method of embeded object inside the form bean." Watch "How to access the gettr/setter method of embeded object inside the form bean." New topic
Author

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

prithvi s zankat
Greenhorn

Joined: Jul 18, 2005
Posts: 12
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

Joined: May 05, 2006
Posts: 181
<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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to access the gettr/setter method of embeded object inside the form bean.
 
Similar Threads
How to correctly access attributes of list member in FreeMaker
struts 2: Stuck up with simple issue
how can i access no static data member in static method is there any solution
Form Bean - Session Scope
synchronization question