引入后,保持jetty默认参数,但在项目中form提交数据的时候,运行到如下代码:
public void extractFormParameters(MultiMap<String> params) {
try {
int maxFormContentSize = 200000;
int maxFormKeys = 1000;
int maxFormKeys;
if (this._context != null) {
ContextHandler contextHandler = this._context.getContextHandler();
maxFormContentSize = contextHandler.getMaxFormContentSize();
maxFormKeys = contextHandler.getMaxFormKeys();
} else {
maxFormContentSize = this.lookupServerAttribute("org.eclipse.jetty.server.Request.maxFormContentSize", maxFormContentSize);
maxFormKeys = this.lookupServerAttribute("org.eclipse.jetty.server.Request.maxFormKeys", maxFormKeys);
}
int contentLength = this.getContentLength();
if (maxFormContentSize >= 0 && contentLength > maxFormContentSize) {
throw new IllegalStateException("Form is larger than max length " + maxFormContentSize);
} else {
InputStream in = this.getInputStream();
if (this._input.isAsync()) {
throw new IllegalStateException("Cannot extract parameters with async IO");
} else {
UrlEncoded.decodeTo(in, params, this.getCharacterEncoding(), maxFormContentSize, maxFormKeys);
}
}
} catch (IOException var6) {
LOG.debug(var6);
throw new RuntimeIOException(var6);
}
}
执行这里:
if (this._context != null) {
ContextHandler contextHandler = this._context.getContextHandler();
maxFormContentSize = contextHandler.getMaxFormContentSize();
maxFormKeys = contextHandler.getMaxFormKeys();
}
获取的参数还是系统默认的200000,jetty-starter中设置的在这里没有加载到,这里的this._context是不等于null的。