我拆过的坑cycx

查询一下!

@RequestParam

param(@RequestParam("id") int id){


    System.out.println("id="+id);

    ModelAndView view = new ModelAndView(PAGE);

    view.addObject("id",id);




@RequestParam  require=false default=0


Requestparam_20220427170708.png



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

@RequestMapping("/param")

public ModelAndView param(@RequestParam(value = "id",defaultValue = "0") int id,

                          @RequestParam(value = "type",required = false,defaultValue = "") String type){

    if(null!=type&&type.equals("苹果")){


    }

    System.out.println("id="+id);

    System.out.println("type="+type);

    ModelAndView view = new ModelAndView(PAGE);

    view.addObject("id",id);



    return view;

}


发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Z-BlogPHP 1.7.3

Copyright Your WebSite.Some Rights Reserved.