wood burning stoves 2.0*
The moose likes Other Application Frameworks and the fly likes How to configure Apache Shiro properly and get proper results? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "How to configure Apache Shiro properly and get proper results?" Watch "How to configure Apache Shiro properly and get proper results?" New topic
Author

How to configure Apache Shiro properly and get proper results?

Vishal Srivastav
Ranch Hand

Joined: Nov 29, 2008
Posts: 46

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.


Vishal Srivastava, Software Engineer (Android), Paradigm Creatives
SCJP 5, SCWCD 5 - http://in.linkedin.com/in/srivastavavishal
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to configure Apache Shiro properly and get proper results?
 
Similar Threads
Struts: DynaValidatorForm not working
Strutsnewbie
org.apache.jasper.JasperException: Unable to compile class for JSP
Internationalization login thru to...
How to send Parameters from JSP to a Servlet?