<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                @RequestMapping:配置請求映射,訪問路徑到具體的對象 path|value : 指定訪問路徑 method : 指定請求方式GET/POST/PUT/DELETE.... params : 指定請求該路徑必須攜帶的參數 **1.GET參數接收** ~~~ @RequestMapping(path="fun1",method= RequestMethod.GET,params={"name","age"}) public String fun1(String name,Integer age){ System.out.println(name); System.out.println(age); return "/demo1"; } ~~~ **訪問路徑** http://localhost:8080/hello/fun1?name=nobb&age=1 ***** **2.簡單表單參數接收** ~~~ //簡單表單參數接收 @RequestMapping(value="fun2", method=RequestMethod.POST ) //接收 id 和 name 兩個參數 public String fun2(Integer id, String name){ System.out.println(id); System.out.println(name); return "/demo1"; } ~~~ **訪問路徑** POST:http://localhost:8080/hello/fun2 參數允許不傳,不傳則為null ***** **3.請求參數和變量名不一致** ~~~ //請求參數和變量名不一致 @RequestMapping(value="fun2", method=RequestMethod.POST ) //將請求參數id 映射為abc public String fun2(@RequestParam("id") Integer abc, String name){ System.out.println(abc); System.out.println(name); return "/demo1"; } ~~~ 注意:這里請求參數id必須填寫 ***** **4.把請求參數封裝到對象中** ~~~ @RequestMapping(path="fun3", method=RequestMethod.POST) public String fun3(User user){ System.out.println(user); return "/demo1"; } ~~~ 注:封裝的對象必須有 get set 方法 請求參數 list array可以用下標傳參 map用 k v傳參 對象用. ![](https://img.kancloud.cn/6a/a2/6aa2543ed336ef27ff42b88d01be8291_904x565.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看