Struts: how to package visual forms used in multple locations

D

davout

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top