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>

寫成上面的這個格式我的就不再報錯。

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