Skip to content
Advertisement

Redirect to another page with @RequestBody

I’m struggling with something.

i pass JSON data to my controller

JavaScript

In my RestController, i handle this information like this

JavaScript

saving the JSON elements into the object myRequest.

The thing is, having @RequestBody forces me to stay in that JSP, but i want to after processing this information, redirects to another page.

Tried with various ways to redirect but the view stays the same (in my console i see the info processing but the view is static)

I read people with the same problem, and their answer was “removing @RequestBody”, but in my case i’m not able to make it work without the @RequestBody.

Is there any way to rediect? or i have to modify all my code?

Advertisement

Answer

I finnally find a workaround, thanks to the comments above:

JavaScript

For some reason, its not entering to .done , but in .fail

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement