java - How to get result on same page why input is required? -


in project updating details created action, gives me exception in response as

no result defined action org.employee.actions.employeemyprofileaction , result input 

in struts.xml (before)

<action name="savepersonaldetails"  class="org.employee.actions.employeemyprofileaction" method="updateemployeedetails">         <result name="success">empmyprofile.jsp</result> </action> 

(after)

<action name="savepersonaldetails" class="org.employee.actions.employeemyprofileaction" method="updateemployeedetails">     <result name="success">empmyprofile.jsp</result>     <result name="input">emp-personal-form.jsp</result> </action> 

ajax call

function checkpersonal(id) {      if (checkeverythingp()) {         $.ajax({             type : 'post',             url : 'savepersonaldetails',             data : $('#personalform').serialize(),             success : function(data) {                 alert('success');             },             error : function() {                 alert('error');             }         });     } } 

it gives me success message in jquery not going action class declared. didn't understand why happening after correct. referred many sites not resolved. please suggest me going wrong.

not correct thought, because in success callback function have received input result. result returned workflow interceptor, in defaultstack - stack of interceptors used default if action doesn't override interceptors configuration. checks if action invocation has validation errors action errors or field errors (the conversion errors) returns result specified parameter inputresultname. default parameter set "input". if interceptor returns result breaks chain of interceptors , invocation of action method. noted saying it not going action class declared.

the solution override interceptors configuration of action use basic stack, i.e. without validation and/or workflow interceptors.

<action name="savepersonaldetails"  class="org.employee.actions.employeemyprofileaction" method="updateemployeedetails">   <interceptor-ref name="basicstack"/>   <result name="success">empmyprofile.jsp</result> </action> 

if still need perform validations can programmatically or configure workflow interceptor filter action method. last option should use if have enough reasons so, because overcomes purpose of interceptor itself.


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -