Struts2 Handle 404 error page and wrong action

1. To handle 404 not found yourself, just add this code to your web.xml

  <error-page>
<error-code>404</error-code>
<location>/pageNotFound.jsp</location>
</error-page>

2. To handle wrong action not mapped in Struts2, just add this code to struts.xml

 <package name="serveAll" namespace="" extends="struts-default">
    <action name="*">
<result>/pageNotFound.jsp</result>
</action>
</package>
上一篇:Leetcode 445. 两数相加 II


下一篇:LeetCode 2. 两数相加(Add Two Numbers)