Eclipse:在调试期间自动加载html / JS更改 [英] Eclipse: Auto-load html/JS changes during debug

查看:550
本文介绍了Eclipse:在调试期间自动加载html / JS更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Java Spark Framework中运行一个应用程序。我在Eclipse中使用 Debug-As-> Java App 运行它。这将成功部署到Java文件的更改。也就是说,我保存一个Java文件,Eclipse编译它,并且运行的应用程序反映了Java文件的更改。



Spark在引擎盖下使用嵌入式Jetty服务器,所以这就像在Eclipse中运行一个嵌入式Jetty应用程序。



任何人都知道一个很好的方式来使HTML和JS更改也被自动部署? / p>

解决方案

为了自动更新项目的静态文件,您可以将它们引用为外部静态文件。你可能会这样做:

  staticFileLocation(relative-path-to-html-and-js); 

为了进行调试,请执行以下操作:

  externalStaticFileLocation(absolute-path-to-html-and-js); 

通过这样做,当您在浏览器中按F5时,您将获得所有更改到html和js代码显示。甚至没有必要重新启动de调试器。重新启动调试器,以防您修改了Java代码。


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?

解决方案

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.

这篇关于Eclipse:在调试期间自动加载html / JS更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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