title:struts2和web.xml错误页面处理
//web.xml
<error-page>
<error-code>404</error-code>
<location>/404.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/500.jsp</location>
</error-page>
<exception-type>java.IO.Exception</exception-type>
<location>/IOException.jsp</location>
</error-page>
//struts2
<package name="default" extends="struts-default">
<default-action-ref name="notFound" />
<action name="notFound">
<result>/struts2.jsp</result>
</action>
</package>
struts2和web.xml错误页面处理
最新推荐文章于 2018-08-05 11:57:52 发布
本文介绍了如何使用web.xml配置文件中的<error-page>元素来处理常见的HTTP错误状态码404和500,并展示了如何在Struts2框架中设置默认的动作引用以处理未找到资源的情况。
168

被折叠的 条评论
为什么被折叠?



