Struts 2: Succes not redirecting when using Ajax Validation
Emili Calonge
Ranch Hand
Joined: May 17, 2003
Posts: 84
posted
0
I have a simple application, a form for creating users. The .java has two methods, the execute and an action for fetching a list of poblations.
So first I call to the fetch method wich gets the list and redirects to the form. The when I submit the form, the validation works perfectly, but when either an error happens or the action succeeds, nothing happens. I just get the destination page as an ajax message when the expected result would be a redirection.
So my configuration is as follows:
So first I call the registreUsuariPrepare action, then I get redirected to ublic/registreUsuari.jsp which contains the form, and when I submit the form, if the success or the error results are returned, I don't get redirected, I just get the contents of index.jsp or error.jsp as an Ajax response.
How can I avoid that and get redirected, what am I doing wrong?
to the jsonValidationWorkflowStack, but it also doesn't work. I think it has to be something with this stack, but all the examples I've seen seem to work fine just like this.
Thanks!
I ran into a similar issue when using the interceptor-ref in the action definition. What I had to do is add other interceptor references.
Try the following:
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
@Richard: servletConfig is already included in the JSON interceptor stack.
@Emili: Is this an Ajax form submit? You don't actually say.
Emili Calonge
Ranch Hand
Joined: May 17, 2003
Posts: 84
posted
0
@David Newton: Yes, I'm using ajax submit with the struts2-jquery library. The submit looks like this:
subject: Struts 2: Succes not redirecting when using Ajax Validation