Question: I have this HTML file which use AngularJs javascript file. And I run this application using `Tomcat 7`

```
<html>
  <head> 
    <script src="src/main/resources/appjs/angular.min.js"></script> // not working
    <script src="/resources/appjs/angular.min.js"></script> // not working
    <script src="/src/main/resources/appjs/angular.min.js"></script> // not working

    <!-- <script src="angular.min.js"></script> --> // working
  </head>
  <body>
  <h2>Hello World!</h2>

  <div ng-app="">
      <p>Name : <input type="text" ng-model="name"></p>
      <h1>Hello {{name}}</h1>
  </div>

 </body>
</html>

```

If I put the JS file in that separate folder it wont work. And If I put it inside the same directory it will work.
What could be the reason for this behavior ?

Answer: 
When giving relative paths with out '/' in the beginning it will start looking for the file relative to the folder where html is present. In you case there is angular.min.js where index.html is located so it works other doesn't.
Your server will be configured to serve files from the "src/main/resources/appjs" directory. If you set the `src` for your `<script>` to "angular.min.js" then the server will dish it up fine.. but if you set the `src` to "src/main/resources/appjs/angular.min.js" then the server is looking for "src/main/resources/appjs/src/main/resources/appjs/angular.min.js", which doesn't exist.

Absolute paths are specified by a URL beginning with a "/", so if you try "/src/main/resources/appjs/angular.min.js" it may work - although security may be an issue and "src" may not be in the root-level directory of your server.