关于Cannot parse POST parameters of request解决方法

异常信息:
界面上一个将列表导出Excel的功能,在Weblogic后台报异常如下:
2010-04-15 17:26:12 ERROR (inner.RequestProcessorImpl:344) -Module [/framework] - Action excute error with path[/ListAction.exportExcel4SQL.do] : Cannot parse POST parameters of request: '/ListAction.exportExcel4SQL.do'
weblogic.utils.NestedRuntimeException: Cannot parse POST parameters of request: '/ListAction.exportExcel4SQL.do'
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.mergePostParams(ServletRequestImpl.java:1875)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.parseQueryParams(ServletRequestImpl.java:1762)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.getQueryParams(ServletRequestImpl.java:1715)
at weblogic.servlet.internal.ServletRequestImpl.getParameter(ServletRequestImpl.java:760)
at com.aaa.ListAction.exportExcel4SQL(EntityListAction.java:377)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)

at $RequestProcessor_127fb5aac99.handleRequest($RequestProcessor_127fb5aac99.java)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2140)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2046)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1398)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
Caused by: java.net.ProtocolException: [color=red]EOF after reading only: '0' of: '6000' promised bytes, out of which at least: '0' were already buffered[/color]
at weblogic.servlet.internal.PostInputStream.complain(PostInputStream.java:93)
at weblogic.servlet.internal.PostInputStream.read(PostInputStream.java:179)
at weblogic.servlet.internal.ServletInputStreamImpl.read(ServletInputStreamImpl.java:228)
at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.mergePostParams(ServletRequestImpl.java:1850)
... 24 more


问题分析
导出到Excel功能的实现是这样的,将查询的SQL保存在页面上一个input域里,导出的时候再利用这个input值,直接post请求服务器,进行数据库查询,再实现导出excel.

在测试过程中发现,当sql比较小的时候,可以正常导出,后台不报错;当sql很大时,后台就报上面的错误.

因此怀疑就是Weblogic的post问题.

解决方法:
在提交表单的时候以post提交并且action 的enctype= "multipart/form-data"。

马上测试,OK!

你可能感兴趣的:(java,sql,weblogic,servlet,Excel)