重新加载Spark / Jetty-server中的静态文件 [英] Reloading the static files in Spark/Jetty-server

查看:323
本文介绍了重新加载Spark / Jetty-server中的静态文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里描述的问题有点类似:

I have a bit similar problem described here:

刷新SparkJava提供的静态文件

在我的应用程序中,用户可以将内容上传到一个文件夹,该文件夹也提供给用户

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

Spark.staticFileLocation("/public");

功能。我知道SparkJava只是在启动时从该文件夹中读取静态内容,并且不知道那里的变化。是否可以通过Spark请求Spark(或Jetty)重新加载静态文件夹中的更改?

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?

推荐答案

移至 externalStaticFileLocation(/ var / www / public);

这篇关于重新加载Spark / Jetty-server中的静态文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆