SPRINGMVC Ajax Page Cannot redirect problem!!!!

Source: Internet
Author: User

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!!!!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.