<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 阅读(2865)
评论(0) 编辑 收藏 所属分类:
调试错误记录