struts2 异常跳转页面配置
2013-05-24 15:32
363 查看
在struts.xml中配置了异常跳转,
<package name="default" namespace="/" extends="struts-default">
<global-results>
<result name="exception-error">/error/exception.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping result="exception-error" exception="java.lang.Exception"></exception-mapping>
</global-exception-mappings>
</package>
其他的action都继承default。
但是,当url输错的时候,页面依然会出现很多异常信息,并没有按照预期跳转至编写的exception错误提示页。
纠结了一阵子后,发现是这里的问题:struts.xml中的配置:
<!--开发模式下使用,这样可以打印出更详细的错误信息-->
<constant name="struts.devMode" value="true" />
将true改为false,
美妙的异常提示页面,出现了!
<package name="default" namespace="/" extends="struts-default">
<global-results>
<result name="exception-error">/error/exception.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping result="exception-error" exception="java.lang.Exception"></exception-mapping>
</global-exception-mappings>
</package>
其他的action都继承default。
但是,当url输错的时候,页面依然会出现很多异常信息,并没有按照预期跳转至编写的exception错误提示页。
纠结了一阵子后,发现是这里的问题:struts.xml中的配置:
<!--开发模式下使用,这样可以打印出更详细的错误信息-->
<constant name="struts.devMode" value="true" />
将true改为false,
美妙的异常提示页面,出现了!
相关文章推荐
- struts2异常页面配置《做参考》
- Struts2中action重定向跳转到jsp页面两种配置方式
- struts2抛出异常自定义跳转页面
- Struts2中action重定向跳转到jsp页面两种配置方式
- Struts2中action重定向跳转到jsp页面两种配置方式
- 配置struts2过滤器 session失效跳转到登陆页面
- Struts2中action重定向跳转到jsp页面两种配置方式带参数
- struts2 异常跳转页面配置
- struts2抛出异常自定义跳转页面
- Struts2中action重定向跳转到jsp页面两种配置方式
- tomcat,web.xml配置异常页面跳转与拦截器问题
- Struts2中action重定向跳转到jsp页面两种配置方式
- struts2 配置 jquery ajax 调用 action 跳转页面
- a标签跳转到配置有angular路由的页面,并控制显示view中的内容
- struts页面跳转和局部刷新配置的五种方式
- Struts2之跳转页面
- 如何在struts2中登录后跳转到前置页面
- iis 中配置 域名登录 跳转页面
- J2EE中在web.xml异常页面跳转
- struts2 之配置拦截器使网站页面在session失效后退回到登录页面