Background explanation:
The previous blog was about using jetty and Maven for development and testing. A small problem encountered during use is that after jetty is started, jsp, xml and other files cannot be saved.
error message:
Solution:
Search for jetty-webapp in the Maven library (i.e. repository), as shown below:
Copy the jetty-webapp*.jar file to the desktop, open it with compression software, and go to the directory "/org/eclipse/jetty/webapp", or directly search for "webdefault.xml" in the compression software, as shown in the figure:
Find the "webdefault.xml" file, open it with the viewer or notepad that comes with the compression software, and then search for "useFileMappedBuffer"
<init-param> <param-name>useFileMappedBuffer</param-name> <param-value>false</param-value> </init-param>
Change "true" to false, then save, copy the modified jar package to its original location and replace the previous jar package.
Or put the webdefault.xml file into the project (such as in the "src/main/resources" directory), and add the following code to the <webAppConfig> tag of the pom.xml file:
<webAppConfig> <contextPath>/${project.artifactId}</contextPath> <defaultsDescriptor>src/main/resources/webdefault.xml</defaultsDescriptor> </webAppConfig>PS: If the above steps still cannot be solved, just restart jetty or Eclipse.
The above is all the content of this article. I hope it will be helpful to everyone's learning and I hope everyone will support Wulin.com more.