HTML文件无法连接到Java文件_java – 无法在eclipse中保存.html文件

我正在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 Admin

myapp

我唯一改变的是它们是如何在web.xml中映射的.基本上,在我使用弹簧控制器等渲染弹簧之前.

现在我使用以下方式静态渲染它们:

default

*.html

*.js

*.css

但我不知道为什么会引起这种问题.

Spring映射如下:

spring

org.springframework.web.servlet.DispatcherServlet

contextClass

org.springframework.web.context.support.AnnotationConfigWebApplicationContext

spring

/

30

任何人都可以帮我弄清楚这里有什么问题,如果有办法让它像我想要的那样工作?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值