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



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', info : $('#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 right 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 utilize 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. lastly alternative should utilize if have plenty reasons so, because overcomes purpose of interceptor itself.

java jquery ajax validation struts2

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -