spring mvc @ModelAttribute @RequestParam

从Form表单或URL参数中获取(实际上,不做此注释也能拿到对象) 注意这时候这个User类一定要有没有参数的构造函数。

@RequestMapping("updateAnesthesiainfoNon.action")
public ModelAndView updateAnesthesiainfoNon(HttpServletRequest request,HttpServletResponse response,@ModelAttribute AnesthesiainfoNon infoNon){

}

 

$.ajax({
        url: $("#basepath").val()+"/updateAnesthesiainfoNon.action?anInfoId="+$("#anInfoId").val(),
        data:$('#addform').serialize(),// 你的formid???

});

anInfoId会装载在infoNon对象上吗???好像是绑定不上???

----------------------------------------------------------------------------------------------------------

@ModelAttribute
public void preRun() {
    System.out.println("Test Pre-Run");
}

在调用所有方法之前,都会先执行preRun()方法。

原文链接    http://www.cnblogs.com/HD/p/4127915.html

原文链接    http://www.bubuko.com/infodetail-649956.html

----------------------------------------------------------------------------------------------------------

 

 

@RequestMapping("toIcutreatmentDataTabPage.action")
public String toRegistrationDataTabPage(@RequestParam("icutreatmenttype") String icutreatmenttype,@RequestParam("p_pk") String p_pk , ModelMap modelMap,
            HttpServletRequest request ){   

 

document.getElementById("optype1_frame").src=

$("#basepath").val()+'/toIcutreatmentDataTabPage.action?icutreatmenttype=fluidTherapy&p_pk=0';

----------------------------------------------------------------------------------------------------------

@RequestParam("fid") String fid                         必须存在,不存在报错
@RequestParam(value="fid", required = false) String fid   不存在返回null

原文链接   http://825635381.iteye.com/blog/2196911

----------------------------------------------------------------------------------------------------------

 

posted @ 2015-07-30 15:02  喝酒骑驴撞城管  阅读(1999)  评论(0编辑  收藏  举报