An application which is developed in struts 1.x version and now it is migrating to spring latest version(4.2.1). I am reusing the exusting struts action classes. To execute some functionality i am writing controller class to set certain value after which i have to call struts action class. I know in spring there is an option named "redirect" to redirect to another method by specifying the url as return "redirect:/url". My question here is will "redirect" keyword work to redirect to struts action from spring controller class? Your answer will be greatly appreciated.
Asked
Active
Viewed 1,259 times
1
-
1A redirect is a redirect, it doesn't matter what you're redirecting to. – Dave Newton Feb 22 '16 at 19:26
-
Hi dave newton, here since the application is having two container one for spring and one for struts, spring redirect will not be knowing which url it has to redirect. – Bhadresh Feb 22 '16 at 19:29
-
1But... you give it the URL to redirect to: http://stackoverflow.com/q/17955777/438992 – Dave Newton Feb 22 '16 at 19:30
-
1when you return "redirect:blammy" from a spring controller, the request is redirected to blammy. The implementation of blammy has exactly zero impact on the redirection. – DwB Feb 22 '16 at 19:33
-
Redirect won't work, if users request A but the server returns B, users will think B is A and after they request B they can't get A. – Roman C Feb 22 '16 at 20:02
-
Redirect means the request the made from client i.e. browser. Browser makes the request. – Kunal Surana Feb 23 '16 at 08:57
-
@KunalSurana you are right. This is not going to work anyway. Is there anyway where I can redirect from spring controller to struts action class. – Bhadresh Feb 24 '16 at 14:18
-
Can you provide the struts action mapping in question. Also specify whether struts project is present in same container as that of your spring project. – Kunal Surana Feb 25 '16 at 05:56