title: After accepting data with @requestbody, I want to return message or realize webpage-jump
body: <p>Controller: </p>
  
  <pre><code>@RequestMapping(value="receive", method=RequestMethod.POST, consumes="application/json")
  @ResponseBody
  public  RegInfo receiveData(@RequestBody RegInfo info){
      String reg_check = regInfoService.checkRegInfo(info);     
       ......
  }
  </code></pre>
  
  <p>RegInfo:</p>
  
  <pre><code>public class RegInfo {
  
  private String account;
  
  private String passwords;
  
  private String realname;
  
  private String phonenumber;
  
  private String sex;
  
  private String mailname;
  .......}
  </code></pre>
  
  <p>register.jsp:</p>
  
  <pre><code>    $("#sub").click(function(){
      var m = {
              "account": $("#_account").val(),
              "passwords": $("#_pass").val(),
              "realname": $("#real_name").val(),
              "phonenumber": $("#phone_number").val(),
              "sex": $("input:checked").val(),
              "mailname": $("#mail_name").val()
          };
      $.ajax({
          type:"POST",
          async : false,
          url:"/demo/user/receive",
          dataType:"json",
          contentType:"application/json; charset=utf-8",
          data:JSON.stringify(m),
          success:function(data){
              alert("ok");
              alert(data.realname);
          },
          erroe:function(data){
              alert("保存失败 ")
          }
      })
  });
  </code></pre>
  
  <p>Now I want to check RegInfo in the controller. If the result of check is legal, I want to jump to other webpage like <code>login.jsp</code> and if it is illegal, I want to return some message and show the message in <code>register.jsp</code>. How can I realize it?
  complete Controller：</p>
  
  <pre><code>    @Controller
  @RequestMapping("/user")
  public class LoginController {
      @Autowired
      private UserService userService;    
      @Autowired
      private RegInfoService regInfoService;
  
      @RequestMapping("/login")
      public String homePage(){
          return "user/login";
      }
  
      @RequestMapping("/loginin")
      public String toLogin(@ModelAttribute("user")User user){
          String u = userService.loginCheck(user);
          System.out.println(u);
          if(u == "success"){
              return "user/success";
          }
          else{
              return "user/login";
          }
      }
  
      @RequestMapping("/register")
      public String toRegister(){
          return "user/register";
      }
  
      @RequestMapping("/success")
      public String toSuccess(){
          return "user/success";
      }
      @RequestMapping(value="receive", method=RequestMethod.POST, consumes="application/json")
      @ResponseBody
      public RegInfo receiveData(@RequestBody RegInfo info){
  
          String reg_check = regInfoService.checkRegInfo(info);
          System.out.println(reg_check);
          System.out.println(info);
          System.out.println(info.getRealname());
          return info;
      }
  }
  </code></pre>