<property name="unauthorizedUrl" value="/sys/unauthorized"/> 不起作用
spring-mvc.xml 中加入:
<!-- 異常處理 -->
<bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="exceptionMappings">
<props>
<prop key="org.apache.shiro.authz.UnauthorizedException">jsp/unauthorized</prop>
<prop key="org.apache.shiro.authz.UnauthenticatedException">jsp/unauthorized</prop>
<prop key="org.apache.shiro.authz.AuthorizationException">jsp/unauthorized</prop>
<prop key="java.lang.Throwable">jsp/unauthorized</prop>
</props>
</property>
</bean>
如果還不能解決:可以看一下web.xml中是否有:
<error-page>
<error-code>400</error-code>
<location>/WEB-INF/template/common/errorPage.jsp</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/WEB-INF/template/common/errorPage.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/sys/unauthorized.html</location>
</error-page>
都屏蔽掉,應該就好了
posted on 2016-10-26 09:40
liufx 閱讀(2872)
評論(0) 編輯 收藏 所屬分類:
調試錯誤記錄