Seeking assistance with my first question regarding Angular tutorials. When I deploy to test the script, I encounter an HTTP 404 error. I have tried various solutions suggested for similar issues without success.
It appears to be a path problem as the angular source pointing to an external (https) works fine while the local source does not. Using eclipse with tomcat 8 and the default servlet may be contributing to this issue. Any help in understanding why this is happening would be greatly appreciated.
Below is the structure of my web:
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/js/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
My HTML file:
<!DOCTYPE html>
<html>
<head>
<title>AngularJS Controllers</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0-beta.5/angular.min.js"></script>
<script type="text/javascript" src="/js/app.js"></script>
</head>
<body>
<div ng-app="app">
<h1>Controllers</h1>
<div ng-controller="MainCtrl">
<p> {{ message }} </p>
</div>
</div>
</body>
</html>
Contents of my .js file:
angular.module('app', []);
angular.module('app').controller('MainCtrl', function ($scope){
$scope.message = 'hello';
});