Thanks for the reply Lukasz.  I thought about doing something like that,
but this page
https://struts.apache.org/core-developers/execute-and-wait-interceptor.html
mentions the ExecuteAndWait interceptor must be at the end of the stack.  I
guess you're saying that is not always the case.  I'll give it a try and
see what happens.  Thanks!

On Mon, Oct 11, 2021 at 1:13 AM Lukasz Lenart <lukaszlen...@apache.org>
wrote:

> czw., 7 paź 2021 o 16:16 Burton Rhodes <burtonrho...@gmail.com>
> napisał(a):
> >
> > Through a recent debugging session I realized that when refreshing a
> "wait"
> > page during an ExecuteAndWait process, it calls the action's prepare()
> and
> > validate() methods each time. For some reason I thought Struts
> > would immediately identify the "waiting" Action, and if it wasn't
> finished,
> > it would return a WAIT result with the running Action at the top of the
> > stack.  I now realize since the ExecuteAndWait filter is at the end of
> the
> > interceptor stack, it obviously doesn't send the WAIT result until all
> > interceptors have been executed.
> >
> > That said, in some of my long running actions the prepare() method hits
> the
> > database for some rather resource heavy database queries. So if I have an
> > executeAndWait page showing the progress status (refreshing every 2
> seconds
> > in my case), this seems incredibly inefficient.  Is there a way to avoid
> > this?  Am I setting up my Action flow incorrectly?
> >
> > A sample of one of my Action setups in struts.xml:
> >
> >  <action name="ContactDelete"
> > class="com.afs.web.struts.action.contact.ContactDeleteAction">
> >             <interceptor-ref name="myParamsPrepareParamsStack" />
> >             <result>/struts/contact/contactDelete_modal.jsp</result>
> >             <result
> > name="error">/struts/common/error/error_modal.jsp</result>
> >             <result
> > name="login">/struts/common/login/login_modal.jsp</result>
> > </action>
> > <action name="ContactDelete_delete"
> > class="com.afs.web.struts.action.contact.ContactDeleteAction"
> > method="delete">
> >             <interceptor-ref name="myDefaultStack"/>
> >             <interceptor-ref name="openSessionExecuteAndWaitInterceptor"
> >
> >                 <param name="delay">0</param>
> >             </interceptor-ref>
> >             <result
> > name="input">/struts/contact/contactDelete_modal.jsp</result>
> >             <result
> > name="wait">/struts/common/progressMonitorWait_modal.jsp</result>
> >
>  <result>/struts/common/progressMonitorSuccess_modal.jsp</result>
> >             <result
> > name="error">/struts/common/error/error_modal.jsp</result>
> >             <result
> > name="login">/struts/common/login/login_modal.jsp</result>
> >   </action>
>
> prepare() and validate() are called by different interceptors, which
> means you must put your Exec&Wait interceptor before them in the
> stack. I would use a custom stack for Exec&Wait actions with proper
> order of interceptors. As I see you have a default stack which is
> prepended to Exec&Wait interceptor and that's why those methods are
> called.
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

Reply via email to