Я пытался отправить пост-запрос Ajax в Struts (1.x) Action. но я получаю HTTP 404 статус не найден всегда.
это мой код ajax
function autoSave(){
//alert('clled auto save function');
console.log('Time duration check');
var form = document.initPetitionerWizardForm;
$.ajax({
url: 'LoadPetitionerWizardPage1.do',
dataType: 'json',
type: 'post',
contentType: 'application/json',
data:$(form).serialize(),
success: function( ){
console.log('success');
},
error: function( ){
console.log( 'something wrong');
}
});
//e.preventDefault();
}
$(document).ready(function(){
setInterval(autoSave,5000);
});
это моя конфигурация распорок xml
<action path="/loadPetitionerWizardPage1"
name="initPetitionerWizardForm"
type="web.clerk.webapp.oop.action.LoadPetitionerWizardPage1Action">
<forward name="FAILURE" path="/Home.jsp" contextRelative="false"/>
<forward name="SUCCESS" path="/PetitionerWizard1.jsp" contextRelative="false"/>
</action>
Это мой класс действий
public class LoadPetitionerWizardPage1Action extends Action {
String LEAGAL_AGENCY = "legal.agency.";
String AGENCY_NAME = "name";
String AGENCY_NUMBERS = "numbers";
String AGENCY_WEB_URL_NAME = "urlname";
String AGENCY_WEB_URL = "url";
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
LoggerUtils.info("Inside " + this.getClass().getName()
+ " --> execute method --> Exit ");
return actionForward;
}// end of method - execute
}