<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # JAX-RS `@Path` URI 匹配 – 靜態和正則 URI > 原文: [https://howtodoinjava.com/resteasy/jaxrs-path-uri-matching/](https://howtodoinjava.com/resteasy/jaxrs-path-uri-matching/) 學習使用 JAX-RS `@Path`注解,并在其中為 **URI 匹配**的內容寫資源路徑。 路徑可以以簡單形式(靜態或路徑參數)或復雜形式(基于正則表達式)編寫。 ## 1\. JAX-RS `@Path` URI 匹配類型 JAX-RS `@Path`注解用于指定其他應用或客戶端可在其上訪問資源的 URI。 [**`@javax.ws.rs.Path`**](http://jackson.codehaus.org/javadoc/jax-rs/1.0/javax/ws/rs/Path.html "path annotation")注解必須存在于類和/或資源方法上。 如果它同時存在于類和方法上,則資源方法的相對路徑是類和方法的連接。 `@Path`中的 URI 以兩種方式定義。 1. 簡單的 URI 匹配 2. 基于正則表達式的 URI 匹配 ## 2\. JAX-RS `@Path` – 簡單的 URI 匹配 以最簡單的形式,URI 由**靜態路徑**以及一些必要的**參數**組成。 * `@Path ("users")` – 與`application/user-management/users`匹配。 * `@Path ("users/{id}")` – 與`application/user-management/users/12`匹配。 ## 3\. JAX-RS `@Path` – 基于正則表達式的 URI 匹配 以復雜的形式,我們可以使用基于參數匹配的[正則表達式](https://howtodoinjava.com/java-regular-expression-tutorials/)。 * `@Path("/users/{id: [0-9]*}")`(僅支持數字)–與`http://localhost:8080/RESTfulDemoApplication/user-management/users/123456`匹配。 * `@Path("/users/{id: [a-zA-Z][a-zA-Z_0-9]}")`(第一個字符字母,然后是字母數字)–與`http:// localhost:8080/RESTfulDemoApplication/user-management/users/abc123`匹配。 [下載源碼](https://docs.google.com/file/d/0B7yo2HclmjI4ZmpTcC0wZTJZRTQ/edit?usp=sharing) 學習愉快!
                  <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>

                              哎呀哎呀视频在线观看