• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts problem

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to Struts forum...
 
Did you miss me? Did you miss this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic