You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by davout <da...@dsl.pipex.com> on 2004/04/30 12:11:40 UTC

How the code Common Visual forms as a 'sub routine'?

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?




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org