Search code examples
javarestlet

Replacing Restlet Error page


Restlet error pages looks like this:

enter image description here

Is there a way to replace Restlet Error pages with custom template and/or redirect to another page (error html pages)?


Solution

  • There are two ways to that:

    • Create a custom status service
    • From Restlet 2.3, use annotation exceptions

    You can return either custom HTML, text or structured content like JSON leveraging Restlet converters.

    This link could give you hints about the way to implement this: https://templth.wordpress.com/2015/02/27/exception-handling-with-restlet/.

    Hope this help you. Thierry