Angular Routes Issue in Wildfly Deployment: Routing Fails in .war Packaged Application Using "jar -cfv"

120 Views Asked by At

Encountering a specific problem with Angular routing when deploying my application on Wildfly, especially when packaged as a .war using the command jar -cfv.

The primary concern is that while I can successfully navigate to the base URL (e.g., http://127.0.0.1:8982/oferta-app), attempting to access specific routes like http://127.0.0.1:8982/oferta-app/pageError401 results in navigation failure. enter image description here

Key Configuration Details

Undertow in Wildfly is configured to handle all requests and redirect them to index.html. The <base> element in my index.html is set as <base href="/oferta-app/">. Angular routing is defined in my application with routes like /pageError401, /pageError402, etc. Despite adjusting configurations, the routing issue persists. Seeking detailed guidance or recommendations on resolving this routing problem specifically within a Wildfly deployment when packaged as a .war file using the jar -cfv command. Any insights would be highly appreciated.

  • I attempted to adjust the Undertow configuration in Wildfly based on the suggestions provided in the official documentation.

  • I modified the standalone.xml file to redirect all requests to index.html.

  • I changed the value of the href attribute in the element in index.html to reflect the route structure in my Angular application.

0

There are 0 best solutions below