Apache shiro(htttp状态间隔服务器错误(POST))

时间:2017-08-24 09:34:34

标签: java mysql database apache tomcat

Message = org.apache.shiro.authc.AuthenticationException:验证用户[admin]时出现SQL错误

我们无法在不同的计算机上运行正确的代码。发布有问题 开始工作

> Shiro.ini
> [main] jdbcRealm=org.apache.shiro.realm.jdbc.JdbcRealm
> jdbcRealm.authenticationQuery = SELECT password FROM users where
> username = ? jdbcRealm.userRolesQuery = select role from users where
> id=(select id FROM users where username =?)



ds = com.mysql.jdbc.jdbc2.optional.MysqlDataSource
ds.serverName = localhost
ds.user = root
ds.password = root
ds.databaseName = marketdb
jdbcRealm.dataSource= $ds



> authc.loginUrl = /giris.html
> #authc.successUrl = /kasiyer/index.html user.loginUrl = /giris.html



[urls]
/giris.html = authc
/logout = logout
/admin/** = user, roles[admin]
/kasiyer/** = user, roles[kasiyer]

main.js

function girisYap() {
    console.log('girisYap');
    $.ajax({
        type: 'POST',
        contentType: 'application/json',
        url: userURL,
        dataType: "json",
        data: formToJSON(),
        success: function(data, textStatus, jqXHR){
            if(data.sonuc=="admin"){
                 top.location.href = '/MarketOtomasyonu/admin/index.html';
            }

            else if(data.sonuc=="kasiyer"){
                 top.location.href = '/MarketOtomasyonu/kasiyer/index.html';
            }


        },
        error: function(jqXHR, textStatus, errorThrown){
            alert('girisYap: ' + textStatus);
        }
    });
}

0 个答案:

没有答案