validation - on action error message not showing on same page -
i have insert , view on same page. problem error message not showing
<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>
and 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>
and action class
public string execute(){//used method 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 exists !"); return error; }} public string viewallcostings(){ //used view data using list return success }
did not getting error message. tried not getting solution
you might have validation errors results input
, action not executed , message isn't set. if want prevent action validation can configure action exclude method validation interceptor. far validation interceptor implements method filter interceptor can in struts.xml
. or add @skipvalidation
annotation on method.
@skipvalidation public string execute(){//used method insert data
Comments
Post a Comment