maven jetty 启动后,不能修改静态文件,js,css,html

Posted developer_os

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了maven jetty 启动后,不能修改静态文件,js,css,html相关的知识,希望对你有一定的参考价值。

解决办法:

1.从jetty的jar包中(位置可能不同,有的jetty-web中)拷贝一份webdefault.xml文件

2.将webdefault.xml 中的useFileMappedBuffer  设置为false。

<init-param>
<param-name>useFileMappedBuffer</param-name>
<param-value>false</param-value>
</init-param>

3.将webdefault.xml文件放在maven web 的pom同级目录
4.修改maven中<configuration>属性,在属性中添加如下配置

<webAppConfig>
<contextPath>/meds</contextPath>
<defaultsDescriptor>webdefault.xml</defaultsDescriptor>
</webAppConfig>

注意:jetty版本不同,可能配置并不相同,有可能不好用,以上配置是在9.4.1.v20170120中是好用的,但在别的版本下可能不好用。














以上是关于maven jetty 启动后,不能修改静态文件,js,css,html的主要内容,如果未能解决你的问题,请参考以下文章