簡體   English   中英

java.lang.IllegalStateException:檢測到單個請求([512])的請求參數超過最大數量(GET加POST)

[英]java.lang.IllegalStateException: More than the maximum number of request parameters (GET plus POST) for a single request ([512]) were detected

我有一個帶有添加按鈕的按鈕,此按鈕向數據表添加一行,就像這樣。

public void addDetail(){
  detail.add(new Detail());
  RequestContext.getCurrentInstance().update(":theDatatable");
}

問題是當數據表有太多行(例如200行)時,因為呈現過程中的ajax調用有很多參數,服務器會拋出此錯誤

java.lang.IllegalStateException: More than the maximum number of request parameters (GET plus POST) for a single request ([512]) were detected. Any parameters beyond this limit have been ignored. To change this limit, set the maxParameterCount attribute on the Connector.

我無法解決此問題,但更改了maxParameterCount,但請求的時間未更改(〜2000ms)

我的問題是:可以通過使用widgetVar的javascript添加一行嗎? 還有其他解決方案嗎?

謝謝!!

編輯:

這是xhtml代碼的一部分。

    <p:dataTable id="theDatatable" var="_det" rowIndexVar="indexVar"
    style="width:100%;" widgetVar="dataTableDetalleWidget" 
    rendered="#{neLiquidacionController.currentCab.tipoLine==neLiquidacionController.facturar.value}"
    editMode="row" editable="true" 
    value="#{neLiquidacionController.detail}">
    <p:ajax event="rowEdit" update="@this" />
    <p:column headerText="Item" width="40" style="background:#EEEEEE;">
        <h:outputText value="#{indexVar+1}" />
    </p:column>
    <p:column headerText="Descripción">
        <p:cellEditor>
            <f:facet name="output">
                <p:outputLabel value="#{_det.productos.descripcion}" />
            </f:facet>
            <f:facet name="input">
                <p:autoComplete id="producto" placeholder="ingrese un valor.."
                    disabled="#{neLiquidacionController.currentCab.estado!='PENDIENTE'}"
                    converter="#{productoConverter}" autocomplete="true"
                    required="true" onfocus="this.select();"
                    onkeypress="if(event.keyCode==27){addDetail();}"
                    completeMethod="#{neLiquidacionController.completeProducto}"
                    var="p" itemLabel="#{p.descripcion}" itemValue="#{p}"
                    scrollHeight="300" forceSelection="true" dropdown="true"
                    value="#{_det.productos}">
                    <p:ajax event="itemSelect" async="true"
                        listener="#{neLiquidacionController.elementChangeProducto}"></p:ajax>
                    <f:facet name="itemtip">
                        <p:panelGrid columns="2">
                            <f:facet name="header">Producto</f:facet>
                            <p:column headerText="Codigo">
                                <h:outputLabel value="#{p.codProducto}" />
                            </p:column>
                            <p:column headerText="Descripcion">
                                <h:outputLabel value="#{p.descripcion}" />
                            </p:column>
                        </p:panelGrid>
                    </f:facet>
                </p:autoComplete>
            </f:facet>
        </p:cellEditor>
    </p:column>
</p:dataTable>

<pe:remoteCommand name="addDetail" async="true" partialSubmit="true"
    process="@this" 
    actionListener="#{neLiquidacionController.addDetail()}">
</pe:remoteCommand>

使用Primefaces 5.0和PrimeFaces擴展2.0

Firebug請求和響應。

javax.faces.ViewState   3374159165244990485:-1029187269574844262
javax.faces.behavior.even...    keypress
javax.faces.partial.ajax    true
javax.faces.partial.event   keypress
javax.faces.partial.execu...    notaEnvioDet:detalle:98:salida
javax.faces.source  notaEnvioDet:detalle:98:salida
notaEnvioDet:detalle:0:co...    7840048000043
notaEnvioDet:detalle:0:pr...    4

......
notaEnvioDet:detalle:98:pr...   680
notaEnvioDet:detalle:98:pr...   AZUCAR CONFITERO X 1Kg.
notaEnvioDet:detalle:98:sa...   37.0
notaEnvioDet:nroDocumento   824

這將發送所有數據表值...響應如下:

<?xml version='1.0' encoding='UTF-8'?>
<partial-response><changes><update id="messages"><![CDATA[<span id="messages"></span><script id="messages_s" type="text/javascript">$(function(){PrimeFaces.cw('Growl','growlWidget',{id:'messages',sticky:false,life:6000,escape:true,msgs:[]});});</script>]]></update><update id="usuarios:j_idt482"><![CDATA[<div id="usuarios:j_idt482" class="ui-messages ui-widget" aria-live="polite"></div>]]></update><update id="javax.faces.ViewState"><![CDATA[3374159165244990485:-1029187269574844262]]></update></changes></partial-response>

如果您使用服務器作為Jboss,則可以在standalone.xml中進行更改,就像

 <system-properties>
    <property name="org.apache.tomcat.util.http.Parameters.MAX_COUNT" value="2000"/>
</system-properties>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM