I use Shiro annotations to verify authorization as follows:
@RequiresPermissions("addresses:list") public ModelAndView getCarrierListPage() { return new ModelAndView("addressList", "viewData", viewData); }
My question is this: if the user does not have the permissions required by the annotation, an exception is thrown. I would prefer to redirect the user to a different URL in case of an exception. How to do it?
Here is my filter configuration:
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"> <property name="securityManager" ref="securityManager"/> <property name="loginUrl" value="/showLoginPage"/> <property name="filterChainDefinitions"> </property> </bean>
java spring spring-mvc shiro
dharm0us
source share