Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best way to create visual form sub routines?

Status
Not open for further replies.

davout

Programmer
Apr 30, 2004
1
0
0
GB
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?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top