This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes How to access the property of action in case of ModelDriven Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to access the property of action in case of ModelDriven" Watch "How to access the property of action in case of ModelDriven" New topic
Author

How to access the property of action in case of ModelDriven

vijay saraf
Ranch Hand

Joined: Jan 08, 2005
Posts: 141
Hello All,

i am having a Action implementing ModelDriven,but Action itself is having the same property as present in Model
[for example Action and Model both are having property 'name']
I want to capture and display the property of Action along with Model.
How can i do that.

Action

Model

Input JSP


What should i write in the place of ??? to access the 'name' property of Action.


Thanks
Vijay Saraf.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

If I remember correctly (which I may not), #action allows you to access action properties directly.

Quite frankly, I think this is a bad idea--either use ModelDriven, or use action properties--don't mix the two modes of operation. You can just expose the model as an action property and avoid this problem altogether.
vijay saraf
Ranch Hand

Joined: Jan 08, 2005
Posts: 141
Thanks David,

I was expecting this, what answer you have given.
Its bad Idea....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to access the property of action in case of ModelDriven
 
Similar Threads
Nested Model Class + ModelDriven + Struts 2
Form Data not being populated in Struts 2
Struts2 Model Driven question for a complex model
Integrating Struts 2 with Hibernate.
How to get subclass objects in an arraylist?