angularjs App on Tomcat Server: Unable to find /app.js 404 Error

Datetime:2016-08-23 03:52:05         Topic: Tomcat  AngularJS          Share        Original >>
Here to See The Original Article!!!

there is deployed my angularjs APP on Tomcat Server by manually copying all the files to /webapps/(mp app) folder .

The index.html does load when I open http://localhost:8080/bar-chart-4/.

But , Tomcat cant find any .js files defined in the index.html, due to Resource Not Found 404 Error and the page is not rendered properly. The screenshot of Errors shown by debugging Page with F12 is shown in image below.

All .js files in index.html have been declared relative to project root folder.

Can someone help me to configure Tomcat to find the files in my Project Folder without making changes to the index.html file?

Solution :

I added this line in my server.xml file .

Context docBase="/bar-chart-4" path=""

And now the app loads fine on opening http://localhost:8080/bar-chart-4/


Put your ads here, just $200 per month.