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

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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM