IDEA web.xml测试创建自定义404和空指针页面

今天出现了这个问题:

Element 'error-page' cannot have character [children], because the type's content type is element-only.

原因是:xml格式的问题,有时候没来的及调整格式可能会报出这个问题

<error-page>
    <exception-type>java.lang.NullPointerException</exception-type>
    <location>/error/nullPoint.jsp</location>
</error-page>
<error-page>
    <error-code>404</error-code>
    <location>/error/d.jsp</location>
</error-page>

写成上面的这个格式我的就不再报错。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章