'How to handle HTTP 510, 598 and 599 error codes in web.xml

We use weblogic to deploy our application, the requirement is to handle all the server errors, in web.xml and have 500 through 510, 598 and 599. The specification of error codes - 510, 598 and 599 throws the following exception:

Exception:
<BEA-101024> Unsupported error status code for error-page in web.xml.

And the code in web.xml is as follows

<error-page>
    <error-code>510</error-code>
    <location>/jsp/main/http_error.jsp</location>
</error-page>

Is there any other way to handle the 3 error codes(510, 598 and 599) or is it not required to be handled at all. Your suggestions on this is highly appreciated. Thanks.



Solution 1:[1]

If your application is going to be returning those errors, presumably you're implementing some relevant feature - an RFC 2774 compliant extension that is returning a 510, and a proxy that is returning 598 and 599. Why not explicitly return the page content you want for those cases in the extension or proxy you are writing rather than using web.xml?

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 rakslice