This is my struts.xml
<struts>
<include file="example.xml"/>
<constant name="struts.devMode" value="true" />
<package name="register" namespace="/register" extends="struts-default,json-default">
<action name="Registration" class="example.Registration">
<result name="success">/SucessPage.jsp</result>
<result name="input">/UserData.jsp</result>
</action>
<action name="validateEmailValue" method="validateEmailValue"
class="example.Registration">
<result type="json"/>
</action>
</package>
</struts>
in jsp page
<s:form action="http://localhost:8080/MyRegistrationProject/register/Registration"
name="data" validate="true">
it validate data but in my action class there are do method execute and validateEmailValue
I have make ajax call using getjson
$.getJSON("http://localhost:8080/MyRegistrationProject/register/validateEmailValue",
{ email:emailId },
function(data) { alert("success") }
);
When I make call for validateEmailValue it gives following error
No result defined for action example.Registration and result input
Any Insight? Thanks
I believe you implemented
validate()in your action classexample.Registrationright?Even though you specified to call the method
validateEmailValue()on your actionvalidateEmailValue, it will first runvalidate()and check if the validation succeed, and will forward the page toINPUTresult if validation failed.Since your
validateEmailValueaction do not have aINPUTresult declared, system throw the error you saw.Try adding the
INPUTresult to yourvalidateEmailValueaction and see what is shown.