springmvc如何向调用此controller的页面内的model里面添加数据

我想这个页面调用controller,然后往这个页面里的model内添加数据,然后再更新标签的html()内容,里面用el标签取刚才放进model内的值,应该怎么做啊,下面是我的代码。

大家都说用json,为什么这样不行啊,el标签只会在加载页面的时候被执行一次吗?还是怎么。

谢谢各位的回答

按钮,调用此方法

 function search(){
        alert(41234123);
        $.ajax({
            type:"post",
            url:"search",
            //data:$("form").serialize(),
            success : function() {
                alert(2412);
                $("#username").html("${user.name}");
                $("#userage").html("${user.age}");
            }
        });
    };

controller代码

 @RequestMapping(value="/search", method = {RequestMethod.POST})
    @ResponseBody
    public void search(Model map) throws Exception {
        String search="qinkai0";
        User user=userService.getUserByName(search);
        map.addAttribute("user",user);
    }

Controller:
@RequestMapping(value="/search", method = {RequestMethod.POST})
@ResponseBody
public void search(Model map, HttpServletResponse response) throws Exception {

    String search="qinkai0";
    User user=userService.getUserByName(search);
            JSONObject json = JSONObject.fromObject(user);
            response.getWriter.write(json.toString());
}

你把返回的数据打印出来看看就知道了,,

加个返回值试试,return map;

Controller返回使用PrintWriter.out方式
ajax请求的success方法加上参数data,从data中取值