Meaningless Drivel is fun!
The moose likes Struts and the fly likes Struts problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts problem" Watch "Struts problem" New topic

Struts problem

siddharth sharma

Joined: Apr 15, 2005
Posts: 8
I have 2 queries,
1.How can i populate a form bean in my action class when that form bean has elements that have array of beans


Ybean[] getBean();


2.If i m doin action chaning, then how should i do exception handling?

say action1 calls action2,action3 and action4.

then if some error occurs in action2,action3 or action4, then how can i catch the exception in action 1, the action class that is working as a controller here.

Can anyone please suggest as to how to go abt it..
Jayesh Lalwani
Ranch Hand

Joined: Nov 05, 2004
Posts: 502
1. You need a Indexed property in your ActionForm. You can find a good explanation on how to put Indexed properties in your ActionForm here

2. As far as I know, each action should handle it's own errors, and each action should have a seperate forward for error condition(s). Practically, you have to create a action "tree" with the main branch containing your action chain, and ofshoots coming out for each error condition. Like this

Ilja Preuss

Joined: Jul 11, 2001
Posts: 14112
Moving to Struts forum...

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
I agree. Here's the link:
subject: Struts problem
It's not a secret anymore!