To call a struts action by Javascript on an event, you need to write a function which is invoked when the event occurs and this function makes an AJAX call. The AJAX call can send a request to the same URL which is provided in action attribute of form tag or html:form tag. e.g. In case your action URL is something like "/registerUserAction.do?action=forgetPasswordForward" that you provide in action attribute of html:form, you can pass the same url to the mentioned code snippet below: function makeRequest(url, callbackfunction) { var http_request = getXMLHttpObject(); url = url + "isComingFromAjax=true"; if (url.indexOf('?') != -1) { url = url + "&" ; } else { url = url + "?" ; } url = url + "isComingFromAjax=true"; http_request.onreadystatechange = callbackfunction; http_request.open('POST', url.substring(0, url.indexOf('?')), true); http_request.setRequestHeader('Content-Type...
Fun Drive with Technology