I think your best bet would be to break up the parameter setting into 2
parts.  (A variation on the paramsPrepareParamsStack) The first part would
set all parameters needed to load the data from the data.  Then in the
prepare, you would have the id's needed to load the data from the database.
The next part would set all the rest of the parameters.  This would be the
approach I would take if I needed to load something from the database before
the parameters are set.
Tom

On 1/25/07, Dale Newfield <[EMAIL PROTECTED]> wrote:

Célio Cidral Junior wrote:
> Well, having Struts passing parameters in the order defined by the
> html form would solve my problem.  :-)

While setting parameters in a request struts has no idea what order they
were ordered in the originally generated form--remember that a single
action may be called from multiple forms on multiple pages that all
order the fields differently.  All struts has to work with is the order
in which the fields are present in the request, which is going to be
different for requests coming from different browsers, going through
different proxies, etc.

If you want to guarantee the order in which parameters are pulled from
the request, don't use the parameters interceptor and do all that
processing yourself in your action.  If you want to use the parameters
interceptor, but you want to ensure that a model object is loaded before
  parameters are set, either explicitly pull the key parameter out of
the request during the prepare call (using prepare in the stack before
parameters), or simply use the parameters interceptor both before and
after the prepare interceptor.

Believe us, you're not the first person to have this problem.  Believe
us, this is the simplest solution from among those that are not broken.

-Dale


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to