1. 程式人生 > >jetty8請求form表單太大解決

jetty8請求form表單太大解決

網上大部分是jetty7 和jetty6 的 

如下設定

Jetty7:org.eclipse.jetty.server.Request.maxFormContentSize=-1

Jetty6:org.mortbay.jetty.Request.maxFormContentSize=-1

我本地是8 的

設定之後 怎麼都不可以

jetty中程式碼

if (_context != null)
                            {
                                maxFormContentSize = _context.getContextHandler().getMaxFormContentSize();
                                maxFormKeys = _context.getContextHandler().getMaxFormKeys();
                            }
                            
                            if (maxFormContentSize < 0)
                            {
                                Object obj = _connection.getConnector().getServer().getAttribute("org.eclipse.jetty.server.Request.maxFormContentSize");
                                if (obj == null)
                                    maxFormContentSize = 200000;
                                else if (obj instanceof Number)
                                {                      
                                    Number size = (Number)obj;
                                    maxFormContentSize = size.intValue();
                                }
                                else if (obj instanceof String)
                                {
                                    maxFormContentSize = Integer.valueOf((String)obj);
                                }
                            }

設定-1就預設是200000  所以還是要設定大小