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