Eh eh. This problem bothered me a day, Baidu a lot of can not.
Just the actual combat SSM framework, do login jump, I am using AJAX to submit data to the backstage, and then the day after tomorrow to return data to the front desk, the foreground to the user some more friendly hints, such as user name or password error.
So I was in the front desk to do a page jump, as if also have tried in the background also not.
The key place to come, in the foreground do page jump, the specified view name also do not Add. JSP and background to specify a URL that is the name of the view.
The key code is as follows
1 success:function (Result) {2 if(result.juese== "Admin"){3 if(result.status== "OK"){4window.location.href= "Admin";5}Else if(result.status== "warning!"){6 $.messager.show ({7 Title:result.status,8 Msg:result.message9 });}Ten One}Else if(result.juese== "Saler") { Awindow.location.href= "Saler"; - $.messager.show ({ - Title:result.status, the Msg:result.message - }); -}Else if(result.juese== "Buyer") { -window.location.href= "Buyer"; + $.messager.show ({ - Title:result.status, + Msg:result.message A }); at}
@RequestMapping (value= "/admin", method=requestmethod.get) public String Admin () { return "admin"; } @RequestMapping (Value= "/saler", method=requestmethod.get) public String Saler () { return "Saler"; } @RequestMapping (Value= "/buyer", method=requestmethod.get) public String Buyer () { return "buyer"; }
SPRINGMVC Ajax Page Cannot redirect problem!!!!