how to redirect user to his personal page after login using apache shiro

I want to redirect user after login to his personal page ? . I have 3 users for e.g 1. admin have access to all pages 2. student have access to pages under student directory 3. teacher have access to pages under teacher directory how to do this? Any help or idea ? **Update** here is my shiro.ini [main] ds = org.apache.shiro.jndi.JndiObjectFactory ds.requiredType = javax.sql.DataSource ds.resourceName = jdbc/myDataSource ds.resourceRef = true jdbcRealm = org.apache.shiro.realm.jdbc.JdbcRealm # password hashing specification sha256Matcher = org.apache.shiro.authc.credential.HashedCredentialsMatcher sha256Matcher.hashAlgorithmName=SHA-256 jdbcRealm.credentialsMatcher = $sha256Matcher jdbcRealm.permissionsLookupEnabled = true jdbcRealm.authenticationQuery = SELECT password FROM users WHERE username = ? jdbcRealm.userRolesQuery = SELECT role_name FROM user_roles WHERE username = ? jdbcRealm.permissionsQuery = SELECT roleper FROM roles_permissions WHERE role_name = ? jdbcRealm.dataSource = $ds authc = jdbcRealm.authorizationCachingEnabled = false # specify login page authc.loginUrl = /login.jsp # redirect after successful login authc.successUrl = /home.jsp # roles filter: redirect to error page if user does not have access rights roles.unauthorizedUrl = /accessdenied.jsp # request parameter with login error information; if not present filter assumes 'shiroLoginFailure' authc.failureKeyAttribute = simpleShiroApplicationLoginFailure [urls] /login.jsp = authc # only users with some roles are allowed to use role-specific pages /admin/** = authc,roles[admin] /stu/** = authc,roles[student] /teach/** = authc,roles[teacher] # enable authc filter for all application pages /ApacheShiroDemo/** = authc
Are you using a shiro login filter or are your custome login? Also what have you tried? Is this in a web application context?

以上就是how to redirect user to his personal page after login using apache shiro的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准