我在同一页面上插入和查看。但问题是错误消息未显示
<action name="ViewAllCostings" class="volo.tms.costings.Costings" method="ViewAllCostings">
<result name="success">/costings/costings.jsp</result>
</action>
<action name="addcosting" class="volo.tms.costings.Costings">
<result name="input">/costings/costings.jsp</result>
<result name="success" type="chain">ViewAllCostings</result>
<result name="error" >/costings/costings.jsp</result>
</action>
和 costings.jsp
<s:actionerror/>
<s:form action="addcosting" method="post">
<s:textfield label="Costing Type" name="costtype" required="true"/>
<s:textfield label="Cost(rs.)" name="costrs" required="true"/>
<s:submit value="ADD" name="addcostbutton"/>
</s:form>
<div class="Wrapper">
<display:table id="txt" name="costinglist" pagesize="10" cellpadding="2px;" cellspacing="5px;" requestURI="">
<display:column property="costtype" title="Cost Type" sortable="true"></display:column>
<display:column property="costrs" title="Cost(rs.)" sortable="true"></display:column>
</display:table></div>
和动作类
public String execute(){//used this method for insert data
ArrayList costList = new ArrayList();
costList.add(costtype);
costList.add(costrs);
costList.add(costid);
if (AddCostDao.insertEditCostDetails(costList)) {
return SUCCESS;
} else {
addActionError("Employee name already exists !");
return ERROR;
}}
public String ViewAllCostings(){
//used for view data using list
return SUCCESS
}
没有收到错误信息。我试过但没有得到解决方案