$(document).ready(function(){
$.ajax({
type:"post",
url:"friendAction!searchUI.action",
data:"<%=request.getParameter("userId") %>",
async:false,
success:function(msg){
alert(msg);
}
});
})
//辅助获取跳转到的页面信息
public ActionForward searchUI(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
//得到好友
Integer userId = Integer.valueOf(request.getParameter("userId"));
userList = userService.getResult("from Users where id=?", new Object[]{userId});
return mapping.findForward(null);
}
已经为userList设了get和set方法。
${userList.name } 打不出值。