2012-12-21 42 views
1

顯示標籤的頁面之間移動時,我收到以下錯誤:錯誤而用struts網頁間導航顯示標籤

請求[/ seatreportsubmit]不包含名爲「方法」處理參數。 這可能是由標籤文本中的空白造成的。

但是,當我點擊搜索按鈕兩次它將移動到下一頁。

過去幾天我在這個問題上掙扎。任何幫助,將不勝感激。

下面是我的一些代碼:

<table width="100%" align="center"> 
    <tr> 
     <td align="Center"> 
      <input type="button" class="buttonstyle" value="<bean:message key="button.search" />" onclick="searchsubmit();" styleClass="buttonstylebig">&nbsp; 
      <input type="button" class="buttonstyle" value="<bean:message key="button.reset" />" onclick="clearValues();"> 
     </td> 
    </tr> 
</table> 

的struts-config:

<action path="/seatreportsubmit" 
     type="com.ford.ape.seatreport.actionobject.SeatRprtAction" 
     name="SeatReportForm" scope="request" input="seatreport.details" 
     validate="true" parameter="method"> 
     <forward name="openSeatDetails" path="seatreport.details" /> 
     <forward name="showSeatDetails" path="seatreport.detailsreport" />   
</action> 

磚高清:

<definition name="seatreport.details" extends="base.definition"> 
    <put name="body" value="/jsp/SeatReport/SeatVacReport.jsp" /> 
</definition> 
<definition name="seatreport.detailsreport" extends="base.definition"> 
    <put name="body" value="/jsp/SeatReport/SeatVacReportDetailed.jsp" /> 
</definition> 

JS:

function searchsubmit() 
{ 
if(search()==true) 
{ 
    if(document.forms[0].seatReportType.value=='Summary Report') 
    { 
     document.forms[0].seatLocation.value=''; 
     document.forms[0].seatBuilding.value=''; 
     document.forms[0].seatFloor.value=''; 
     document.forms[0].seatType.value=''; 
     document.forms[0].seatStatus.value=''; 
     document.forms[0].seatCompany.value=''; 
     document.forms[0].seatDepartment.value=''; 
     document.forms[0].seatSubDepartment.value=''; 
     document.forms[0].seatLL5.value=''; 
     document.forms[0].seatLL6.value=''; 

     document.forms[0].method.value="loadPage"; 
     document.forms[0].submit(); 
    } 

    else if(document.forms[0].seatReportType.value=='Detailed Report') 
    { 
     document.forms[0].method.value="showSeatRprt"; 
     document.forms[0].submit(); 
    } 
} 
} 

下面是使用的顯示標籤。

<display:table name="requestScope.SeatReportForm.rprtData" id="table" export="true" sort="list" requestURI="/seatreportsubmit.do" pagesize="20" align="center" class="table_main" width="100%"> 

<display:column width="5%" align="center" class="hidden" media="Excel" title="Request No" headerClass="table_header" > 
<%=((SeatRprtVO)table).getSeatNo()%> 
</display:column> 
<display:column class="label_text" property="seatLocation" title="Location" headerClass="table_header" width="7%" align="center"/> 
<display:column class="label_text" property="seatBuilding" title="Building" headerClass="table_header" width="3%" align="center"/> 
<display:column class="label_text" property="seatFloor" title="Floor" headerClass="table_header" width="4%" align="center"/> 
<display:column class="label_text" property="seatNo" title="Seat No" headerClass="table_header" width="4%" align="center"/> 
<display:column class="label_text" property="seatType" title="Seat Type" headerClass="table_header" width="7%" align="center"/> 
<display:column class="label_text" property="seatStatus" title="Seat Status" headerClass="table_header" width="7%" align="center"/> 

<%-- <display:column class="label_text" property="seatCategory" title="Seat Category" 
headerClass="table_header" width="7%" align="center"/> --%> 

<display:column class="label_text" property="cdsID" title="CDSID" headerClass="table_header" width="4%" align="center"/> 
<display:column class="label_text" property="firstName" title="First Name" headerClass="table_header" width="7%" align="center"/> 
<display:column class="label_text" property="lastName" title="Last Name" headerClass="table_header" width="7%" align="center"/> 
<display:column class="label_text" property="ll6CdsId" title="LL6 CDSID" headerClass="table_header" width="7%" align="center"/> 
<display:column class="label_text" property="ll5CdsId" title="LL5 CDSID" headerClass="table_header" width="7%" align="center"/> 
<display:column class="label_text" property="ll4CdsId" title="LL4 CDSID" headerClass="table_header" width="7%" align="center"/> 
<display:column class="label_text" property="employeeType" title="Employee Type" headerClass="table_header" width="7%" align="center"/> 
<display:column class="label_text" property="company" title="Company" headerClass="table_header" width="7%" align="center"/> 

<display:column class="label_text" property="department" title="Department" headerClass="table_header" width="7%" align="center"/> 
<display:column class="label_text" property="subDepartment" title="Sub-Department" headerClass="table_header" width="7%" align="center"/> 
<display:column class="label_text" property="region" title="Region" headerClass="table_header" width="7%" align="center"/> 


<display:setProperty name="export.xls.filename" value="rprtData.xls"/> 
<display:setProperty name="css.tr.even" value="row1" /> 
<display:setProperty name="css.tr.odd" value="row2" /> 
<display:setProperty name="paging.banner.placement" value="bottom" /> 
<display:setProperty name="basic.msg.empty_list" value="No Records Found" /> 

</display:table> 

回答

0

感謝您的回覆..我想我的問題得到解決......問題是在請求頁面查詢字符串中傳遞的大量數據...由於查詢字符串超過了允許的長度獲取請求後,方法='showSeatRprt'在查詢字符串的稍後追加,分頁無法找到參數方法,並且查詢字符串被截斷。

因此它顯示相應的消息...現在其工作正常...

3

您收到錯誤消息是自我解釋:您缺少method參數。

從你的代碼看來你使用的是DispatchAction。這種類型的Struts Action包含一堆「個性化execute方法」,並使用請求參數來確定要調用哪一個。你的情況,請求參數被稱爲method

<action path="/seatreportsubmit" .... parameter="method"> 

這必須是存在於所有的請求到你的動作或支柱不知道叫什麼方法。

我看到你已經有兩種方法叫loadPageshowSeatRprt。你有別人嗎?你有沒有收到分頁請求?

當您在頁面之間導航時,顯示標記將從requestURI參數開始創建正確的請求URL,您的情況爲requestURI="/seatreportsubmit.do"。我認爲這是你錯過method參數的地方。

嘗試在你的Action類中添加一個handlePaging方法然後更改顯示標籤的requestURI到這樣的事情:requestURI="/seatreportsubmit.do?method=handlePaging",看看它是否得到控制,當你通過網頁瀏覽。