我有下面的代碼片段如何找到丟失的參數或錯誤的PARAM [沒有結果的行動定義,並導致輸入]在Struts2
從XML文件
<action name="list-process-solution" class="actions.ProcessSolutionAction" method="listProcessSolutions">
<interceptor-ref name="store">
<param name="operationMode">RETRIEVE</param>
</interceptor-ref>
<interceptor-ref name="defaultStack"/>
<result name="success">process_solution_list.jsp</result>
<result name="input">process_solution_list.jsp</result>
<result name="error">Error.jsp</result>
<result name="login">Login.jsp</result>
</action>
<action name="delete-process-solution" class="actions.ProcessSolutionAction" method="crudProcessSolution">
<interceptor-ref name="store">
<param name="operationMode">STORE</param>
</interceptor-ref>
<interceptor-ref name="defaultStack"/>
<result name="success" type="redirectAction">
<param name="actionName">list-process-solution</param>
<param name="nsec">${nsec}</param>
</result>
<result name="error">Error.jsp</result>
<result name="login">Login.jsp</result>
</action>
刪除我重定向後列表頁(再次同頁)
但我得到的結果input
不知道我錯了。
我已經完成了這個鏈接刪除
<s:url var="varDeletePS" action="delete-process-solution">
<s:param name="nsec">
<s:property value="nsec"/>
</s:param>
<s:param name="processId">
<s:property value="processId"/>
</s:param>
<s:param name="opType">
<s:property value="2" />
</s:param>
</s:url>
<s:a href="%{varDeletePS}" id="id-delete-PS-link" cssClass="class-delete">
Delete
</s:a>
在行動,我有這些領域與getter和setter
private ProcessSolution processSolution;
private short opType;
private String nsec;
型號ProcessSolution
請參閱本link
我的問題是
如何處理結果名稱input
在這裏?我不知道哪個參數錯誤?
更新: -
如何繼續redirectAction
後同樣的要求,所以我有我的請求參數?
如何確定哪些領域有錯誤?
更新2:
我delete-process-solution
正常執行,但對結果成功,並redirectAction
到list-process-solution
,我得到的結果輸入,如果你有返回
對於輸入結果,您沒有'redirectAction'。在'input'結果頁中使用'
'和/或''標籤。您也可以啓用devMode。 –@AleksandrM,我沒有做任何輸入驗證,順便說一句有沒有什麼辦法來找到哪個領域有問題的設置(在我的行動類設置)..? –
PLZ檢查更新2 –