默认 的 name: form: action = "/ login" name = "username" name = "password" <form id = "myform" method = "post" style = " text-align : center" action = "/ login" > <div style = " margin : 20 px 0 " > <label id = "uname" > 用户 名</label> <input name = "username" type = "text"class = "easyui-validatebox" opciones de datos = "required: true, validType: 'noNull', missingMessage: ' 用户 名 不能 为 空'" > <br> <br> <label id = "pd" > 密& nbsp; & nbsp; 码</label> <input name = "contraseña" type = "contraseña" class = "easyui-validatebox" data-options = "required: true, missingMessage: ' 密码 不能 为 空'" > </div> <div> <input id = "loginButton"type = "button" class = "easyui-linkbutton"style = " anchura : 60 px ; altura : 30 px" value = " 登录" οnclick = " submitForm () " > <input id = "resetButton" type = "reset" class = "easyui-LinkButton" style = " anchura : 60 px ; altura : 30 px " value = " 重置" > </div> </form>
Configuración en springsecurity:
<http use-expression = "true" > <encabezados> <frame-options policy = "SAMEORIGIN" /> </headers> <csrf disabled = "true" /> <intercept-url pattern = "/ login.html" acceso = "permitAll" /> <intercept-url pattern = "/ content / updatePassword.html" access = "permitAll" /> <intercept-url pattern = "/ resources / **" access = "permitAll" /> <intercept-url pattern = "/ **" acceso= "isAuthenticated ()" /> <form-login login-page = "/ login.html" authentication-failure-url = "/ error.html? erroe = true" default-target-url = "/ index.html" always-use-default-target = "true" /> <logout /> </http> <authentication-manager> <authentication-provider> <jdbc-user-service data-source-ref = "dataSource" usuarios por username-query = "SELECT usercode, password, enabled FROM [user] WHERE usercode =?" Authority -by-username-query = "SELECCIONAR código de usuario, /> <password-encoder hash="md5"/> </authentication-provider> </authentication-manager>