会struts 2.0的请进 在<global-exceptions>标签中配置,出错的类型和用于显示错误信息的页面,开发文档中有写吧! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在系统的web.xml文件里配置 <error-page> <error-code>404</error-code> <location>/html/error.html</location></error-page>保证error.html足够大,大于1027B 文档中查到 <global-results> <result name="unhandledException">/unhandled-exception.jsp</result> </global-results> <global-exception-mappings> <exception-mapping exception="java.lang.Exception" result="unhandledException"/> </global-exception-mappings>将错误指向java.lang.Exception看如何,另外在web.xml中指定出错处理也是一个选择 谢谢您,zhongwenly,你的解决方案我用过了,是能解决一些问题的,但我的问题并没有解决,呵呵,我也找到了我自己的解决方案,分享一下看看吧:<default-action-ref name="UnderConstruction"></default-action-ref><action name="UnderConstruction"> <result>/notfound.jsp</result></action>用个默认的这样就过滤掉了一些不存在的action而导致的错误,服务器也不会有异常出现了 你可以参照struts2。0权威指南里的做法。在struts.xml里设置一个通配action,这个action跳转的result为error.jsp注意一定要放在最后这样,当输入不存在的action时,会自动跳转到error.jsp servlet+jsp中实现分页显示的问题 ORACLE sql语句 把列转行,再把重复的去掉,之间用;连接!问题! 文本框中输入的中文到程序中显示为乱码 在哪里设session过期时间 iso-8859-1编码解析不了"彧"这个字,该怎么处理啊?急等待 请问一下,web迅雷,点网页关闭按钮时,最小化到右下交任务栏是怎么实现的? 如何能让鼠标离开填写区域之后就弹出提示或者脚本? 再次提问购物车的问题 js带参数开窗口问题。 如何在JSP中修改表单的value? Tomcat 启动时错误 关于< a herf>调用参数问题 ?20080913提问
<error-page>
<error-code>404</error-code>
<location>/html/error.html</location>
</error-page>保证error.html足够大,大于1027B
<global-results>
<result name="unhandledException">/unhandled-exception.jsp</result>
</global-results> <global-exception-mappings>
<exception-mapping exception="java.lang.Exception" result="unhandledException"/>
</global-exception-mappings>
将错误指向java.lang.Exception看如何,另外在web.xml中指定出错处理也是一个选择
<default-action-ref name="UnderConstruction"></default-action-ref>
<action name="UnderConstruction">
<result>/notfound.jsp</result>
</action>
用个默认的这样就过滤掉了一些不存在的action而导致的错误,服务器也不会有异常出现了
在struts.xml里设置一个通配action,这个action跳转的result为error.jsp
注意一定要放在最后
这样,当输入不存在的action时,会自动跳转到error.jsp