javajettyspark-java

Can't load Spark static sub-directories


Here's my problem:

I copied this structure into my "public" folder (under resources) just like in the Spark documentation. and added this folder as a static folder using:

staticFiles.location("/public");
init();

But now, only the files inside "/public" and the immediate-childs of the folders can be accessed, i.e:

What should I do to include all sub-directories as static files?

Thanks.

UPDATE: If I open a file that wasn't found in NetBeans, add a new line and saves the file - the file can later be found when I run the program! Any ideas for why's that?


Solution

  • If anyone ever encounter this issue - you should:

    1. clean your project.
    2. build it again.
    3. only then try to run it (clicking the Play button).

    Worked for me (using NetBeans IDE).