Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts problem

 
siddharth sharma
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

eg

XformBean
{
setBean(Ybean[]);
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
Posts: 502
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Struts forum...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic