scala/lift jetty IntelliJ Idea:导入的 javascript 文件未显示服务页面中的更改
我以前从未在论坛上提出过问题,所以如果我违反了规则,那是无意的,我很抱歉。
我正在 IntelliJ Idea IDE 中使用 scala/lift 和 jetty 制作一个 Web 应用程序。我有一个为 .net 框架设计的 javascript 调试 web 应用程序,尽管我使用 .net 服务器的目的只是为它提供服务,因为它严格在 html 和 javascript 中运行。我想对 lift/scala/jetty 服务器提供的页面使用我的调试工具,我目前正在移植它,以便它可以在新服务器上工作。我遇到的问题是我的调试工具中的 html 页面导入外部 javascript 文件,如下所示:
<script type = "text/javascript" src = "jsFile.js"></script>
现在这似乎一开始可以工作,但是当我对 src javascript 文件进行更改时,它们并没有在由 提供服务的页面中发生举起。我通过浏览器中查看页面源页面中的链接验证了这一点,它在我将其添加到项目之前显示了文件的版本。如果我更改文件系统中的文件名,IDE 会立即识别出它无法解析 jsFile.js 的路径。我尝试通过站点地图提供页面并将我的项目转储到 /static 目录中。我已经重新启动了浏览器、ide、服务器、操作系统。我已经重建了项目,重新制作了模块并完成了同步。我从 scatch 创建了一个新项目并遇到了同样的问题。我相信,如果我在哪里动态地使用 lift 通过 JsRaw 插入我的 javascript ,它会解决问题,但我仍然想知道为什么这不起作用,以防我做错了什么,会再次咬我有一天。任何想法将不胜感激。
I have never asked a forum question before so if I'm breaking a rule its unintentional and I'm sorry.
I have a webapp that I am making using scala/lift and jetty in the IntelliJ Idea IDE. I have a javascript debug webapp that I designed for .net frame work although all I used the .net server for was to serve it because it runs strictly in in html and javascript. I want to use my debug tool for pages that are served by the lift/scala/jetty server and I am currently porting it so that it will work on the new server. The problem that I am having is that the html pages in my debug tool import external javascript files like so:
<script type = "text/javascript" src = "jsFile.js"></script>
now this seemed to work at first but when I made changes to the src javascript file they were not happening in the page that was served by lift. I verified this by following the link in the view page source page from the browser and it showed the version of the file before I added it into the project. If I change the name of the file in the file system the IDE recognizes right away that it can't resolve the path to jsFile.js. I have tried serving the pages through the site map as well as dumping my project in the /static directory. I have restarted, browser,ide, server, os. I have rebuilt the project, remade the module and have done a synchronize. I have created a new project from scatch and ran into the same problem. I believe that if I where to dynamically use lift to insert my javascript with JsRaw it would fix the problem but I still want to know why this isn't working in case its something that I'm doing wrong that will rear up bite me again someday. Any thoughts would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的模板中,尝试使用 lift 标签 with-resource-id 将您的标签括起来,
例如
如果这不能解决问题,您是否使用 SBT 来构建您的 lift 应用程序?如果是这种情况,您可以运行一个终端
,它基本上监视 scala 文件以及 html/css/js 文件的更改并更新正在运行的 jetty(必须由 sbt 启动并运行:
In your template, try to enclose your tags with the lift tag with-resource-id
like
If this does not solve the problem, are you using SBT to build your lift app? If this is the case, you can have one terminal running
which basically watches for changes on scala files as well as html/css/js files and updates the running jetty (which has to be started by sbt as well running: