Jetty-web.xml配置值未使用

huangapple go评论105阅读模式
英文:

Jetty-web.xml values not used

问题

我正在使用Jetty 9.2.9,在其中部署了一些应用程序。在这里不提供任何配置文件的情况下,你能想到为什么仅在部署的第一个应用程序中读取和使用jetty-web.xml吗?在WEB-INF/jetty-web.xml中的其他应用程序中,如果它格式不正确,我会得到一个异常,但这些值不会应用于此Web应用程序。我尝试覆盖maxFormKeys和maxFormContentSize,我的jetty-web.xml如下所示:

<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">

<Configure class="org.eclipse.jetty.webapp.WebAppContext">
	<Set name="maxFormKeys">2000</Set>
	<Set name="maxFormContentSize">211111</Set>
</Configure>

我知道这很困难,但由于项目很庞大,如果有人有一些整体指导方针可以指引我思考的方向,而不是试图找到确切的解决方案,那将会更好。提前谢谢。

英文:

I am using Jetty 9.2.9 in which I am deploying some amount of apps. Without giving here any configuration files, can you think of any reason why the jetty-web.xml is read and use in only the first app which is deployed? In the other apps in WEB-INF/jetty-web.xml is read, if it is malformed I have an exception, but the values are not applied to this web app. I am trying to override maxFormKeys and maxFormContentSize, my jetty-web.xml looks like this

&lt;?xml version=&quot;1.0&quot;  encoding=&quot;ISO-8859-1&quot;?&gt;
&lt;!DOCTYPE Configure PUBLIC &quot;-//Jetty//Configure//EN&quot; &quot;http://www.eclipse.org/jetty/configure.dtd&quot;&gt;

&lt;Configure class=&quot;org.eclipse.jetty.webapp.WebAppContext&quot;&gt;
	&lt;Set name=&quot;maxFormKeys&quot;&gt;2000&lt;/Set&gt;
	&lt;Set name=&quot;maxFormContentSize&quot;&gt;211111&lt;/Set&gt;
&lt;/Configure&gt;

I know this is hard, but since the project is massive it would be better if somebody has some overall guidelines to point me in a direction to think, instead of trying to find exact solution.
Thanks in advance.

答案1

得分: 1

请查阅Jetty文档,特别是:https://www.eclipse.org/jetty/documentation/current/setting-form-size.html。该部分描述了为单个Web应用程序与为部署在服务器上的所有Web应用程序设置此配置的不同方法。

如果可能的话,您还应将Jetty版本升级到最新版本,因为Jetty 9.2版本非常旧且已经停止维护,所以使用该版本可能会出现问题。当前版本是9.4.28。

英文:

Take a look the documentation the jetty documentation, specifically: https://www.eclipse.org/jetty/documentation/current/setting-form-size.html. This section describes the different ways to set this configuration for an individual webapp vs for all webapps deployed on the server.

You should also upgrade your Jetty version to the latest version if possible, Jetty 9.2 is very old and is End-Of-Life, so this might be an issue with using that version, the current version is 9.4.28 at the moment.

huangapple
  • 本文由 发表于 2020年5月5日 13:27:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/61606321.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定