On Thu, Jul 17, 2008 at 7:58 PM, Jishnu Viswanath <[EMAIL PROTECTED]> wrote: > Hey in your case for the input field not null any such silly thing you > can actually write validation xml. > > That will actually take care of returning back to the page with input > error.
Actually I can't. In my real code I need to execute the action in order to populate it with some data so that the form page can use <s:iterator> to build some input elements from data on the stack. And I don't want any action/field errors when this field is missing. > Regarding the long time to take thingy, I don't know how the return > SUCCESS is going to help the client, the client browser will wait for > the server to respond, if its too long it will actually get timed out. > The best solution is ajax. No, the execAndWait interceptor is made just for this. It takes a really long time to get the return of SUCCESS. The user actually gets back the "wait" result even though it's not in the code. The "wait" result includes a meta-refresh to keep hitting the action. The action (stored in the session automatically) will continue to return "wait" until the first refresh after the return of SUCCESS. See http://struts.apache.org/2.x/docs/execute-and-wait-interceptor.html The trick to my example is that usually the execAndWait interceptor automatically forwards someone to "wait". By adding the delay param I'm giving the action half a second to return a result ("input") before sending them to the "wait" page. I just think that maybe no one has bother to document how to apply this interceptor when you want the form replaced with the progress page. That way you don't have to resubmit the form to get back to the progress page if you navigate away. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]