qq_35501877 2018-04-25 09:28 采纳率: 100%
浏览 1518
已结题

java web 关于404,500设置的问题

在java 设置中配置400,500页面,应该怎么设置,我在网上搜索了,
基本上都是在web.xml中设置:
<!-- 错误 -->

500
/admin/error


404
/admin/notfound//这个地方是不是用了spring mvc就这么写

但是就是跳转不到我的错误页面。
我用了shiro做权限,网上说在web.xml加:
<!-- Shiro Filter is defined in the spring application context: -->

shiroFilter
org.springframework.web.filter.DelegatingFilterProxy

targetFilterLifecycle
true

<filter-mapping>
    <filter-name>shiroFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>ERROR</dispatcher>
</filter-mapping>
    但这个加了,我项目全部的访问路径,都访问不出来,而且也没有访问到我的404页面
  • 写回答

6条回答 默认 最新

  • qq_35501877 2018-04-25 09:30
    关注

    怎么问题写出来就是这么个鬼
    在web.xml设置

    500
    /admin/error//这个地方是不是用了spring mvc就这么写


    404
    /admin/notfound//这个地方是不是用了spring mvc就这么写

    评论

报告相同问题?

悬赏问题

  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误