I have a question about how best to organize the code for a Struts visual
form that is used in multiple locations in a web app. Think of this as a
common visual form that can be opened in a variety of calling situations
My thoughts on how best to organize this are...
* Define a bean that encapsulates the sub routine style parameters required
to prepare the form for display, like.. form title, business data
parameters, return address, form result (OK/Cancel) , and form data result
* Have the calling point create and populate the bean and save this to a
session based attribute.
* In the Struts action associated with the common visual form., find the
bean from the session based attribute, extract the sub routine parameters,
set up the form and forward to input.
* On the form being completed have the action class retrieve the sub routine
bean, update the form result and form data result properties, save the
updated bean to the session attribute, and then forward control to the
return address defined in the bean.
Is this the best way of addressing this issue?
form that is used in multiple locations in a web app. Think of this as a
common visual form that can be opened in a variety of calling situations
My thoughts on how best to organize this are...
* Define a bean that encapsulates the sub routine style parameters required
to prepare the form for display, like.. form title, business data
parameters, return address, form result (OK/Cancel) , and form data result
* Have the calling point create and populate the bean and save this to a
session based attribute.
* In the Struts action associated with the common visual form., find the
bean from the session based attribute, extract the sub routine parameters,
set up the form and forward to input.
* On the form being completed have the action class retrieve the sub routine
bean, update the form result and form data result properties, save the
updated bean to the session attribute, and then forward control to the
return address defined in the bean.
Is this the best way of addressing this issue?