Reloading static files in a Spark / Jetty server

I have a slightly similar problem described here:

Update Static Files Serviced by SparkJava

In my application, the user can upload content to a single folder, which is also provided to the user using

Spark.staticFileLocation("/public"); 

function. I realized that SparkJava reads β€œstatic” content from this folder only once at startup, and it does not know about the changes there. Can I ask Spark (or Jetty via Spark) to reload the changes in the static folder?

+5
source share
1 answer

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

+5
source

Source: https://habr.com/ru/post/1238648/


All Articles