修改html不用重启jetty,怎么设置jetty

在pom.xml里加入如下代码时,是加在哪里? <groupId>org.mortbay.jetty</groupId><artifactId>maven-jetty-plugin</artifactId><version>6.x</version><configuration> <webDefaultXml>src/main/resources/webdefault.xml</webDefaultXml></configuration>
2026年09月20日 12:00
有3个网友回答
网友(1):

步骤如下:

在你使用.m2\repository\org\eclipse\jetty\jetty-webapp\8.1.0.RC2\jetty-webapp-8.1.0.RC2.jar中找到webdefault.xml,它在jar文件中的路径是org/mortbay/jetty/webapp/webdefault.xml。把它拷贝到项目中,比如src/test/resources/webdefault.xml.

找到useFileMappedBuffer参数,把值设成false


useFileMappedBufferparam-name>
false
init-param>

在pom.xml中,设置jetty使用更新过的webdefault.xml文件

org.mortbay.jettygroupId>
maven-jetty-plugin
8.1.0.RC2

...

src/test/resources/webdefault.xml

网友(2):

步骤如下:

在你使用.m2\repository\org\eclipse\jetty\jetty-webapp\8.1.0.RC2\jetty-webapp-8.1.0.RC2.jar中找到webdefault.xml,它在jar文件中的路径是org/mortbay/jetty/webapp/webdefault.xml。把它拷贝到项目中,比如src/test/resources/webdefault.xml.

找到useFileMappedBuffer参数,把值设成false


useFileMappedBufferparam-name>
false
init-param>

在pom.xml中,设置jetty使用更新过的webdefault.xml文件

org.mortbay.jettygroupId>
maven-jetty-plugin
8.1.0.RC2

...

src/test/resources/webdefault.xml

网友(3):

步骤如下:

  1. 在.m2\repository\org\eclipse\jetty\jetty-webapp\8.1.0.RC2\jetty-webapp-8.1.0.RC2.jar中找到webdefault.xml,它在jar文件中的路径是org/mortbay/jetty/webapp/webdefault.xml。把它拷贝到项目中。

  2. 找到useFileMappedBuffer参数,把值设成false。如下所示:


        useFileMappedBufferparam-name>
        false
    init-param>

  3.  在pom.xml中,设置jetty使用更新过的webdefault.xml文件。如下所示:

org.mortbay.jettygroupId>
    maven-jetty-plugin
    8.1.0.RC2
    
        ...
        
               src/test/resources/webdefault.xml
         

    

完成上面三个步骤就设置成功了。