對web.xml與struts.xml進行配置,防止在自己主頁下出現輸錯網址產生異常.
歡迎頁面
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<exception-type>java.lang.ArithmeticException</exception-type>
<location>/errors/error.jsp</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/errors/404.jsp</location>
</error-page>
<!--配置默認action,輸錯網址自動跳轉默認action -->
<default-action-ref name="error"></default-action-ref>
<action name="error">
<result>/errors/404.jsp</result>
</action>
</package>