JBOSS web.xml configuration file with Angular application

1.1k Views Asked by At

WE have simple angular 7 app.I made production Build with ng build -- href .once the build is done we placed the dist folder to the server location. application works fine but when i refresh the application the server(JBOSS) is not able to identify the location of the page ..

so we have modified the web.xml in jboss server to handle 404

<error-code>404</error-code>
<location>/xyz/index.html</location>
</error-page>

but the server is not able to idenify the path

1

There are 1 best solutions below

2
Avinash Dalvi On

You have to set to handle 400 and 403 status code. Because any server doesnt understand which is root file when your refresh page or application.

We need to configure this either in server rewrite rule or config file.

<error-page>
    <!-- Missing login -->
    <error-code>400</error-code>
    <location>/xyz/index.html</location>
</error-page>
<error-page>
    <!-- Forbidden directory listing -->
    <error-code>403</error-code>
    <location>/xyz/index.html</location>
</error-page>
<error-page>