0

I wanted to distinguish between "deployment pending" and "deployment failed" and display a loading or a error page respectively. Therefore I tried to set the value default-response-code in the undertow configuration.

<host name="default-host" alias="localhost" default-response-code="503">

But when I start the server I still receive 404's when accessing the address of my deployment during the deployment process.

Did I miss something or is there a better way to show a loading page during a the deployment process?

André
  • 464
  • 4
  • 17

2 Answers2

2

I solved this problem by adding a custom Undertow HttpHandler as WildFly module. After adding this handler as filter in my WildFly configuration it returns HTTP Status Code 503 until the deployment unit is successfully deployed.

I followed this example with a few modifications: https://github.com/thomasdarimont/undertow-extensions

André
  • 464
  • 4
  • 17
1

The failure of the 503 to over-ride the 404 can be fixed by following the advice here http://lists.jboss.org/pipermail/undertow-dev/2017-January/001861.html which suggests removing the welcome-content filter. This does fix the issue. However it still remains how to customise the 503 page as 503 - Service Unavailable is not a very user friendly message.

Shaun O'Hagan
  • 191
  • 1
  • 5