3

my index.html and my app .js are located in different folders

- WEB-INF
  --resources
    -js
      -app.js
  --views
    -index.html

I tried to import my app.js into my index.html using :

<script src="../resources/js/app.js"></script>  

but it didn't work . I got this error :

GET http://localhost:8080/projectname/resources/js/app.js

Yuri
  • 447
  • 3
  • 9
  • 19

1 Answers1

0

Unless you use some IDE like VisualStudio, etc.

Files on your site's root folder are referred like this: src="/[fileInYourRootFolder]"

So files on a subfolder are referred like this:src="/[subfolder]/[fileInSubfolder]"

guysigner
  • 2,822
  • 1
  • 19
  • 23