我用的是jquery1.6,使用jquery中的post方法时,可以这样传值:
$.post("getUserInfo",
{userID: $("#typeSel").val()},
function(data){
$("#queryCriteriaArea").html(data);
});
这样可以将userID传值给Action中的成员变量userID,
但是如果我想将userID传值给action中的成员变量User(是一个VO)的userID属性,该如何操作呢?
{"User.userID": $("#typeSel").val()}
属性名加上引号,试试看行不行。
[color=red]{User.userID: $("#typeSel").val()}[/color]
这样就可以了。
按照你说的,action中已经拿到了userID的值
user中的userID属性要有他的set,get方法
调用他的set方法set进去就可以了
user.setUserID(userID)