如何强制 MyEclipse 将 JavaScript 文件热部署到我的 JBoss 实例?

发布于 2024-09-06 01:38:53 字数 525 浏览 4 评论 0原文

我在将 MyEclipse 7.1.1 文件热部署到 JBoss 4 服务器时遇到问题。

问题是这样的:当我的服务器运行时,我可以对各种 JAVA 和 HTML 文件进行更改,然后立即进行热部署(当我刷新页面时,我可以看到浏览器中反映的更改)。然而,在处理特定的 JavaScript 文件时,我的更改并未被热部署。这使得处理和调试该文件变得非常困难,因为每次进行更改时我都必须停止我的服务器,重新部署并重新启动它。这是一个新问题 - 这个文件以前没有发生过这种情况,所以我认为我的 MyEclipse 配置中出现了问题。

我已经验证我的项目(JBoss 4 实例)都设置为“分解”模式以进行热部署。

我也 99% 确信这不是我的浏览器的问题,因为我总是使用 CTRL+F5 刷新,并且我尝试了很多方法,例如清除浏览器缓存以获取文件的当前部署版本。

我还尝试在服务器运行时对项目进行“清理”,这也没有强制部署。

任何类型的解决方案都会有帮助。我希望 MyEclipse 自动部署该文件,但我也愿意在处理该文件时手动强制热部署该文件。

谢谢。

I'm having trouble with MyEclipse 7.1.1 hot-deployment of files to my JBoss 4 server.

The problem is this: while my server is running, I can make changes to various JAVA and HTML files, which are then hot-deployed immediately (I can see the changes reflected in my browser when I refresh the page). However, while working on a particular JavaScript file, my changes are not being hot-deployed. This makes it very difficult to work on and debug this file, since I have to stop my server, redeploy, and start it again each time I make changes. This is a new problem - it didn't used to happen with this file, so I think something got screwed up in my MyEclipse configuration.

I've verified that my projects (JBoss 4 instances) are all set up in "Exploded" mode for hot-deployment.

I'm also 99% sure that this isn't an issue with my browser, since I always refresh with CTRL+F5, and I've tried a number of things like clearing my browser cache to get the currently deployed version of the file.

I've also tried doing a "clean" on the project while the server is running, and that didn't force a deployment either.

Any sort of solution would be helpful. I'd love for MyEclipse to deploy the file automatically, but I'm also open to manually forcing hot-deployment of this particular file while I work on it.

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

向地狱狂奔 2024-09-13 01:38:53

事实证明这是 IE 和应用程序缓存策略的问题。

以下修复了该问题:

  1. 将 GZIP 压缩环境变量设置为 OFF。这样GZIP压缩的JS文件两周内不会被缓存。
  2. 将IE8设置为“每次访问网页时检查存储页面的较新版本”,并使用CTRL+F5刷新(和以前一样)。

This turned out to be a problem with both IE and the application caching strategy.

The following fixed it:

  1. Setting a GZIP compression environment variable to be OFF. This way the GZIP compressed JS files are not cached for two weeks.
  2. Setting IE8 to "check for newer versions of stored pages every time I visit the webpage", and using CTRL+F5 to refresh (as before).
月光色 2024-09-13 01:38:53
   var dwScriptFileUrl = location.protocol + '//' + location.host + '/' + appName + '/extend.js?' + Math.random();
   var dwDOM = document.all('myiframe0').contentWindow.document;
var dwScript = dwDOM.createElement("script");
dwScript.type = "text/javascript";
dwScript.src = dwScriptFileUrl;
dwDOM.body.appendChild(dwScript);
   var dwScriptFileUrl = location.protocol + '//' + location.host + '/' + appName + '/extend.js?' + Math.random();
   var dwDOM = document.all('myiframe0').contentWindow.document;
var dwScript = dwDOM.createElement("script");
dwScript.type = "text/javascript";
dwScript.src = dwScriptFileUrl;
dwDOM.body.appendChild(dwScript);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文