After shiro login, the path does not change and the request path also has the original path.

the path of the address bar after shiro login is incorrect
clipboard.png

clipboard.png

clipboard.png

use springmvc and easyui
form forms as follows. This kind of request can also jump to the page. If I replace it with an ajax request, I won"t jump to the home page even if I login successfully.

<form class="form-horizontal" id="loginform" name="loginform" 
      method="post" action="../userControl/user_login.action">        

            ... 
            
    <a href="javascript:$("-sharploginform").submit();" id="loginform:j_id19" 
        name="loginform:j_id19" class="btn btn-danger" target="_blank"></a>
    
    <!-- <a id="loginBtn"  class="btn btn-danger"></a> -->

</form>

Login method

@RequestMapping(value="user_login",produces = "text/plain;charset=utf-8")
    public String login(User user,HttpServletRequest request) {

        Subject subject = SecurityUtils.getSubject();
        String password = new Md5Hash(user.getPassword(), user.getUsername(), Constant.MD5_HASH_ITERATIONS).toHex();

        // 
        UsernamePasswordToken token = new UsernamePasswordToken(user.getUsername(), password);

        try {
            // 
            subject.login(token);
            return "index";
        } catch (Exception e) {
            // 
            e.printStackTrace();
            return "login";
        }
    }
< H1 > what is the problem with the path of this address bar, and the refresh also contains the form information of the page before the jump. If you change it to ajax, you will not jump to the page directly < / H1 >.
Jul.26,2021

background redirect to index use redirect:/index

Menu