解决该问题方法,修改tomcat/conf/context.xml文件,增加资源最大可缓存的大小:
<Context>
<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<Resources
cachingAllowed="true"
cacheMaxSize="100000"
/>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
</Context>
<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>WEB-INF/tomcat-web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
<Resources
cachingAllowed="true"
cacheMaxSize="100000"
/>
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--
<Manager pathname="" />
-->
</Context>
转自:

本文介绍了解决Tomcat中资源缓存大小限制的方法。通过修改context.xml文件中的配置,可以设置资源的最大缓存大小为100000字节,确保应用程序能够正确加载并缓存较大的资源文件。
1万+

被折叠的 条评论
为什么被折叠?



