Hi Friends,
I am trying to use apache shiro into my project as I have to create a role based mechanism into my project. I created a demo project with following configurations...
I created following files into my project -
index.jsp
login.jsp
success.jsp
denied.jsp
logout.jsp
showUser.jsp
My
shiro.ini configuration is as follows -
I am using a
servlet LoginTestServlet.java to dispatch to
login.jsp page or
success.jsp after authentication is successful/unsuccessful -
I am using
TOMCAT 6.0.
My problem is -
1. Whenever I am trying to enter credentials at
login.jsp page, its automatically taking me to the respective page for the credentials I enter. Ex., if I try to enter ROLE_MEMBER credentials after clicking for
success.jsp, its taking me to
success.jsp page. But if I try to enter ROLE_ADMIN after clicking for same
success.jsp, its automatically taking me to
secret.jsp as per the servlet code written instead of going to
denied.jsp.
2. How to make a generic code without writing a separate servlet for each resource to show login success or denied page?
Also, is there any way to create custom permissions in shiro for every resource? If yes, then how. If there is any link to this, I would be grateful to you.
Thanks all.