문제

I'm calling Struts 2 action from jQuery like below code.

jQuery( "#dialog-form" ).dialog({ 
    autoOpen: false,
    height: 300,
    width: 350,
    modal: true,
    buttons : {
        "Search" : function() {
            jQuery.ajax({
                type : 'POST',
                url : ' <s:submit action="part" method="find" /> '
             })
        }
    }
});

Is there any way to call struts action from jquery ?

도움이 되었습니까?

해결책

Use

jQuery("#dialog-form").dialog({ 
  autoOpen: false,
  height: 300,
  width: 350,
  modal: true,
  buttons : {
    "Search" : function() {
      jQuery.ajax({type : 'POST',
        url : '<s:url action="part" method="find"/>'
      }); 
    } 
  }
});

submit tag will not render the url, use url tag instead.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top