2

Environment: - Front end developed in Angular 6. - Backend developed in Java Spring boot. - Hosted in wildfly app server.

Description: If we navigate through the route(Angular route) it's working fine. But once page getting reload/refresh, it's throwing 404 error.

This error is throwing from backend, i think due to the url pattern. To fix that we have to update the deployment descriptor file (i.e. web.xml).

1

2 Answers 2

0

I was experiencing the same issue but on IIS, i resolved my error by adding { useHash: true } to my RouterModule.

My NgModule annotation in my routing module now looks as following:

@NgModule({
  exports: [RouterModule],
  imports: [RouterModule.forRoot(routes, { useHash: true })],
})
Sign up to request clarification or add additional context in comments.

1 Comment

It work fine but i got some alternate solution as well. I updated in deployment descriptor file for each url pattern, and redirected to index page.
0

Make sure that the Wildfly server is returning index.html for all non-static-file GET requests.

Related posts:

Rewrite engine for wildfly

https://developer.jboss.org/thread/236258?_sscc=t

https://www.google.co.in/search?q=wildfly+url+rewriting&oq=wildfly+url+rewriting

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.