问题
I am running an app in Java Spark Framework. I run it in Eclipse with Debug-As->Java App
. This successfully deploys the changes to the Java files. That is, I save a Java file, and Eclipse compiles it, and the running app reflects the changes to the Java file.
Spark uses an embedded Jetty server under the hood, so this is just like running a embedded Jetty app in Eclipse.
Anyone aware of a good way to cause the HTML and JS changes to also be auto-deployed?
回答1:
In order to auto update the static files of your project, you can reference them as external static files. You're probably doing this:
staticFileLocation("relative-path-to-html-and-js");
Instead of the above, do the following for debug purposes:
externalStaticFileLocation("absolute-path-to-html-and-js");
By doing so, when you press F5 in your browser, you're going to get all your changes to html and js code shown. It's even unnecessary to restart de debugger. Restart the debugger just in case you modified your Java code.
来源:https://stackoverflow.com/questions/33703585/eclipse-auto-load-html-js-changes-during-debug