我正在eclipse中开展一个javascript项目.静态html和javascript文件需要访问我的服务的restful端点,所以我把这些端点放在java项目中,所以我可以访问它们而不会出现跨域问题.
但是,突然间,如果我尝试将更改保存到我的html文件中,除非我停止运行java应用程序,否则我无法做到.
事件的顺序是这样的:
Run java web app with Jetty
Can save changes to html file.
Open html file in chrome with url: http://127.0.0.1:8901/myapp/myapp-admin.html
Cannot save changes to html file.
Close chrome.
Still can't save changes.
Stop jetty running in eclipse.
Can save changes.
当我尝试保存它时出现以下错误:
Save could not be completed. Try File > Save As... if the problem persists.
Reason:
Could not write file:
C:\{path to file}\myapp-admin.html
(The requested operation cannot be performed on a file with a user-mapped section open)
如果我尝试使用save as来覆盖该文件,它仍然无效,但错误:
Save could not be completed. Could not write file: {etc.}
这是html文件:
/p>
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
myapp Adminmyapp
我唯一改变的是它们是如何在web.xml中映射的.基本上,在我使用弹簧控制器等渲染弹簧之前.
现在我使用以下方式静态渲染它们:
default
*.html
*.js
*.css
但我不知道为什么会引起这种问题.
Spring映射如下:
spring
org.springframework.web.servlet.DispatcherServlet
contextClass
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
spring
/
30
任何人都可以帮我弄清楚这里有什么问题,如果有办法让它像我想要的那样工作?