在<global-exceptions>标签中配置,出错的类型和用于显示错误信息的页面,开发文档中有写吧!

解决方案 »

  1.   

    在系统的web.xml文件里配置
    <error-page>
      <error-code>404</error-code>
      <location>/html/error.html</location>
    </error-page>保证error.html足够大,大于1027B
      

  2.   

    文档中查到
          <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中指定出错处理也是一个选择
      

  3.   

    谢谢您,zhongwenly,你的解决方案我用过了,是能解决一些问题的,但我的问题并没有解决,呵呵,我也找到了我自己的解决方案,分享一下看看吧:
    <default-action-ref name="UnderConstruction"></default-action-ref>
    <action name="UnderConstruction">
        <result>/notfound.jsp</result>
    </action>
    用个默认的这样就过滤掉了一些不存在的action而导致的错误,服务器也不会有异常出现了
      

  4.   

    你可以参照struts2。0权威指南里的做法。
    在struts.xml里设置一个通配action,这个action跳转的result为error.jsp
    注意一定要放在最后
    这样,当输入不存在的action时,会自动跳转到error.jsp