Where to put static files for Spark Web Framework?

前端 未结 4 895
予麋鹿
予麋鹿 2020-12-08 07:21

Where do I put files when trying to serve static files with the Spark web framework?

I haven\'t been able to find anything online - I\'m beginning to suspect I don\'

4条回答
  •  死守一世寂寞
    2020-12-08 08:08

    1. Right click your project on Eclipse, select create New -> Package. Give the new package a name, etc.

    2. Put your static resources under that package, so we can be sure they're under your classpath.

    3. In your Main class colde, call staticFileLocation("yourpackagename/");

提交回复
热议问题