要将动作映射到方法,您应该执行以下操作
<action name="selectstate" method="selectstate"> <result>/selecttag.jsp</result> </action>
操作名称应没有操作扩展名,并且默认情况下将结果命名为“成功”,此处的JSP路径应为绝对路径。
调用ajax
$.ajax({ type : "GET", url : "<s:url action='selectstate'/>", dataType : 'text/javascript', data: {'name' : $("#selectedCountry").text()}, success : function(result){ if (result != null && result.length > 0){ $("statesdivid").html(result); } }, error : function(xhr, errmsg) {alert("No values found..!!");}});


