Reloading the static files in Spark/Jetty-server
Asked Answered
C

1

6

I have a bit similar problem described here:

Refresh static files served by SparkJava

In my application user can upload the content to one folder that is also served to user with

Spark.staticFileLocation("/public");

feature. I've understood that SparkJava is reading the 'static' content from that folder only once at startup and it is not aware of changes there. Is it possible to ask Spark (or Jetty via Spark) to reload the changes in static folder?

Conform answered 18/12, 2015 at 15:1 Comment(0)
H
6

Move to externalStaticFileLocation("/var/www/public");

Hookah answered 4/3, 2016 at 12:42 Comment(1)
You can use a relative path such as externalStaticFileLocation("src/main/resources/public/") for development. You can make use of a argument(--dev) to switch between externalStaticFileLocation and staticFileLocationParkerparkhurst

© 2022 - 2024 — McMap. All rights reserved.