Java 7/8请求参数大小限制 [英] Java 7/8 request parameters size limit

查看:358
本文介绍了Java 7/8请求参数大小限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近升级了我的应用程序.我的应用程序使用Java Web API,以及servlet和jsp. 我在新版本中做了从Java 7到Java 8的切换.

我的服务器现在使用的是使用Java 8的Wildfly10平台.以前是使用Java 7的Jboss 7.

在我的应用程序的先前版本中,当我在特定页面上添加+-300个属性时,我的应用程序崩溃了,这使得我的请求网址很长.但是在我的新版本中,如果不对特定代码进行更改,这将不再是问题.

在Java 7和Java 8中,请求URL的大小限制是否有所不同?

解决方案

这不是Java版本,而是重要的应用服务器.应用服务器正在尝试保护您的Web应用程序免受各种攻击,包括所谓的哈希冲突DOS攻击".为了抵制此类攻击,Web服务器对可以通过URL传递的参数数量施加了限制. Wildfly的设置为max-parameters(您可以在中找到说明.官方文件). JBoss 7和Wildfly 10都具有限制发布请求最大大小的设置(分别为maxPostSizemax-post-size),也许您在以前的应用程序版本中偶然发现了该请求.

您可以找到有关这些参数的讨论以及其他一些详细信息此处.

I've upgraded recently my application. My application uses the Java web API, with servlets and jsp's. I made in the new release the switch from Java 7 to Java 8.

My server uses now the Wildfly10 platform, which uses Java 8. Previous it was Jboss 7, which uses Java 7.

In the previous version of my application, my app crashed when I was adding +- 300 attributes at a specific page, which made my request url long. But in my new version, it's not a problem anymore, without making changes at the specific code.

Is there a difference in the size limits of request url's in Java 7 and Java 8?

解决方案

It's not the Java version, its the app server that matters. App servers are trying to protect your web applications from various attacks, including so called 'hash collision DOS attack'. To beat back such attacks web servers impose limits on the number of parameters that can be passed via URL. Wildfly has the setting max-parameters (you can find the description in the official documentation). Both JBoss 7 and Wildfly 10 also have settings that limit the maximum size of a post request (maxPostSize and max-post-size respectively), maybe you stumbled across it in your previous app version.

You can find discussions of these parameters with some additional details here and here.

这篇关于Java 7/8请求参数大小限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆