首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

jetty&tomcat对待表单过长有关问题

2012-09-20 
jetty&tomcat对待表单过长问题结论两句话:?tomcat知道自己处理不了了,什么也不干过去了jett知道自己处理不

jetty&tomcat对待表单过长问题

结论两句话:

?

tomcat知道自己处理不了了,什么也不干过去了

jett知道自己处理不了了,抛个IllegalStateException出来通知一下

jetty默认允许的content-length=200×1000

启动方式

?

?tomcat默认允许的content-length=2×1024×1024
protected void parseParameters() {......    if (!("application/x-www-form-urlencoded".equals(contentType)))        return;    int len = getContentLength();     if (len > 0) {        int maxPostSize = connector.getMaxPostSize();   // tomcat默认大小2*1024*1024          if ((maxPostSize > 0) && (len > maxPostSize)) {            if (context.getLogger().isDebugEnabled()) {                context.getLogger().debug(                        sm.getString("coyoteRequest.postTooLarge"));            }            return;   // 内容超长则直接返回,jetty会抛出IllegalStateException            //Parameters 对象没有内容    }.....}public Map<String, String[]> getParameterMap() {    if (parameterMap.isLocked())        return parameterMap;    Enumeration<String> enumeration = getParameterNames();    while (enumeration.hasMoreElements()) {        String name = enumeration.nextElement();        String[] values = getParameterValues(name);        parameterMap.put(name, values);    }    parameterMap.setLocked(true);    return parameterMap;}public Enumeration<String> getParameterNames() {    if (!parametersParsed)        parseParameters();    return coyoteRequest.getParameters().getParameterNames();}

热点排行