如何使用struts2在jsp中创建3个动态相关选择框

时间:2015-07-01 10:46:46

标签: javascript java jquery ajax struts2

function myfunction(var1) {
    var params =var1; //values for passing to struts if any
    var resultStringX = $.ajax({
        type: "POST",
        url:"loadImportAasthiPage1.action", // struts2 action call
        data: params,
        async: false
        }).responseText;
    // the returning result will be stored in resultStringX variable        
    resultStringX=$.trim(regn);         
}
<s:form action="loadImportAasthiPage1">
    <s:select label="What's your favor search engine" id="ward"
            headerKey="-1" headerValue="Select Search Engines"
            list="wardList" 
            name="wardNum" 
            value="wardNumber" onchange="myfunction(10)" />

    Regn List 
    <s:select name="propertyId"  
        list="propertyList" listKey="propertyId" 
        id="regn" listValue="regnName" 
        headerKey="0" headerValue="--select--" />

</s:form>
String wardNum;

我获得了wardNum的空值。

请告诉我们如何将值从JavaScript传递给动作类

0 个答案:

没有答案