I'm trying to use the Prepare interceptor in conjunction with the
Parameters interceptor to create objects from persistent storage before
Struts 2 sets their properties based on values posted from a form, as
suggested in
http://struts.apache.org/2.0.11/docs/prepare-interceptor.html

 

My understanding of the steps involved is as follows:

 

1. The ParametersInterceptor creates objects based on the values posted
to the form.

2. The prepare method called by the PrepareInterceptor replaces those
objects with objects instantiated from a database.

3. The ParametersInterceptor is called again, updating the objects
constructed from the database with the values posted in the form.

 

The first 2 steps work fine, but not the 3rd.

 

The Parameters interceptor is definitely being called before and after
the Prepare interceptor, but the second call doesn't set the properties
of the objects created in step 2.

 

The intercept stack for the my is:

 

            <interceptor-ref name="fileUpload"/>

            <interceptor-ref name="params">

                <param name="ordered">true</param>

            </interceptor-ref>

            <interceptor-ref name="database"/>

            <interceptor-ref name="prepare"/>  

            <interceptor-ref name="params">

                <param name="ordered">true</param>

            </interceptor-ref>

 

Am I overlooking something, or is there something else I need to do?

 

Thanks,

Mark

Reply via email to