| <!DOCTYPE HTML> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (11.0.2) on Wed Sep 23 17:36:24 GMT 2020 --> |
| <title>Path (jakarta.ws.rs-api 3.0.0 API)</title> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="dc.created" content="2020-09-23"> |
| <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.css" title="Style"> |
| <script type="text/javascript" src="../../../script.js"></script> |
| <script type="text/javascript" src="../../../jquery/jszip/dist/jszip.min.js"></script> |
| <script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> |
| <!--[if IE]> |
| <script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> |
| <![endif]--> |
| <script type="text/javascript" src="../../../jquery/jquery-3.3.1.js"></script> |
| <script type="text/javascript" src="../../../jquery/jquery-migrate-3.0.1.js"></script> |
| <script type="text/javascript" src="../../../jquery/jquery-ui.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="Path (jakarta.ws.rs-api 3.0.0 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var pathtoroot = "../../../"; |
| var useModuleDirectories = true; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <header role="banner"> |
| <nav role="navigation"> |
| <div class="fixedNav"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a id="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/Path.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../index-all.html">Index</a></li> |
| <li><a href="../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <ul class="navListSearch"> |
| <li><label for="search">SEARCH:</label> |
| <input type="text" id="search" value="search" disabled="disabled"> |
| <input type="reset" id="reset" value="reset" disabled="disabled"> |
| </li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Field | </li> |
| <li><a href="#annotation.type.required.element.summary">Required</a> | </li> |
| <li>Optional</li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#annotation.type.element.detail">Element</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| </div> |
| <div class="navPadding"> </div> |
| <script type="text/javascript"><!-- |
| $('.navPadding').css('padding-top', $('.fixedNav').css("height")); |
| //--> |
| </script> |
| </nav> |
| </header> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <main role="main"> |
| <div class="header"> |
| <div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">jakarta.ws.rs</a></div> |
| <h2 title="Annotation Type Path" class="title">Annotation Type Path</h2> |
| </div> |
| <div class="contentContainer"> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <hr> |
| <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Target.html?is-external=true" title="class or interface in java.lang.annotation" class="externalLink">@Target</a>({<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/ElementType.html?is-external=true#TYPE" title="class or interface in java.lang.annotation" class="externalLink">TYPE</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/ElementType.html?is-external=true#METHOD" title="class or interface in java.lang.annotation" class="externalLink">METHOD</a>}) |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html?is-external=true" title="class or interface in java.lang.annotation" class="externalLink">@Retention</a>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/RetentionPolicy.html?is-external=true#RUNTIME" title="class or interface in java.lang.annotation" class="externalLink">RUNTIME</a>) |
| <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html?is-external=true" title="class or interface in java.lang.annotation" class="externalLink">@Documented</a> |
| public @interface <span class="memberNameLabel">Path</span></pre> |
| <div class="block">Identifies the URI path that a resource class or class method will serve requests for. |
| |
| <p> |
| Paths are relative. For an annotated class the base URI is the application path, see <a href="ApplicationPath.html" title="annotation in jakarta.ws.rs"><code>ApplicationPath</code></a>. For an |
| annotated method the base URI is the effective URI of the containing class. For the purposes of absolutizing a path |
| against the base URI , a leading '/' in a path is ignored and base URIs are treated as if they ended in '/'. E.g.: |
| </p> |
| |
| <pre> |
| @Path("widgets") |
| public class WidgetsResource { |
| @GET |
| String getList() {...} |
| |
| @GET @Path("{id}") |
| String getWidget(@PathParam("id") String id) {...} |
| } |
| </pre> |
| |
| <p> |
| In the above, if the application path is <code>catalogue</code> and the application is deployed at |
| <code>http://example.com/</code>, then <code>GET</code> requests for <code>http://example.com/catalogue/widgets</code> will be |
| handled by the <code>getList</code> method while requests for <code>http://example.com/catalogue/widgets/<i>nnn</i></code> |
| (where <code><i>nnn</i></code> is some value) will be handled by the <code>getWidget</code> method. The same would apply |
| if the value of either <code>@Path</code> annotation started with '/'. |
| </p> |
| |
| <p> |
| Classes and methods may also be annotated with <a href="Consumes.html" title="annotation in jakarta.ws.rs"><code>Consumes</code></a> and <a href="Produces.html" title="annotation in jakarta.ws.rs"><code>Produces</code></a> to filter the requests they will |
| receive. |
| </p></div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>1.0</dd> |
| <dt><span class="simpleTagLabel">Author:</span></dt> |
| <dd>Paul Sandoz, Marc Hadley</dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="Consumes.html" title="annotation in jakarta.ws.rs"><code>Consumes</code></a>, |
| <a href="Produces.html" title="annotation in jakarta.ws.rs"><code>Produces</code></a>, |
| <a href="PathParam.html" title="annotation in jakarta.ws.rs"><code>PathParam</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- =========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="annotation.type.required.element.summary"> |
| <!-- --> |
| </a> |
| <h3>Required Element Summary</h3> |
| <table class="memberSummary"> |
| <caption><span>Required Elements</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colSecond" scope="col">Required Element</th> |
| <th class="colLast" scope="col">Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td> |
| <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#value()">value</a></span></code></th> |
| <td class="colLast"> |
| <div class="block">Defines a URI template for the resource class or method, must not include matrix parameters.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== --> |
| <section role="region"> |
| <ul class="blockList"> |
| <li class="blockList"><a id="annotation.type.element.detail"> |
| <!-- --> |
| </a> |
| <h3>Element Detail</h3> |
| <a id="value()"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>value</h4> |
| <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> value</pre> |
| <div class="block">Defines a URI template for the resource class or method, must not include matrix parameters. |
| |
| <p> |
| Embedded template parameters are allowed and are of the form: |
| </p> |
| |
| <pre> |
| param = "{" *WSP name *WSP [ ":" *WSP regex *WSP ] "}" |
| name = (ALPHA / DIGIT / "_")*(ALPHA / DIGIT / "." / "_" / "-" ) ; \w[\w\.-]* |
| regex = *( nonbrace / "{" *nonbrace "}" ) ; where nonbrace is any char other than "{" and "}" |
| </pre> |
| |
| <p> |
| See <a href="http://tools.ietf.org/html/rfc5234">RFC 5234</a> for a description of the syntax used above and the |
| expansions of <code>WSP</code>, <code>ALPHA</code> and <code>DIGIT</code>. In the above <code>name</code> is the template parameter name |
| and the optional <code>regex</code> specifies the contents of the capturing group for the parameter. If <code>regex</code> is |
| not supplied then a default value of <code>[^/]+</code> which terminates at a path segment boundary, is used. Matching of |
| request URIs to URI templates is performed against encoded path values and implementations will not escape literal |
| characters in regex automatically, therefore any literals in <code>regex</code> should be escaped by the author according |
| to the rules of <a href="http://tools.ietf.org/html/rfc3986#section-3.3">RFC 3986 section 3.3</a>. Caution is |
| recommended in the use of <code>regex</code>, incorrect use can lead to a template parameter matching unexpected URI |
| paths. See <a href="http://download.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html">Pattern</a> for |
| further information on the syntax of regular expressions. Values of template parameters may be extracted using |
| <a href="PathParam.html" title="annotation in jakarta.ws.rs"><code>PathParam</code></a>. |
| </p> |
| |
| <p> |
| The literal part of the supplied value (those characters that are not part of a template parameter) is automatically |
| percent encoded to conform to the <code>path</code> production of |
| <a href="http://tools.ietf.org/html/rfc3986#section-3.3">RFC 3986 section 3.3</a>. Note that percent encoded values |
| are allowed in the literal part of the value, an implementation will recognize such values and will not double encode |
| the '%' character. |
| </p></div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>URI template.</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </main> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <footer role="contentinfo"> |
| <nav role="navigation"> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a id="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a id="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/Path.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../index-all.html">Index</a></li> |
| <li><a href="../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../allclasses.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Field | </li> |
| <li><a href="#annotation.type.required.element.summary">Required</a> | </li> |
| <li>Optional</li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#annotation.type.element.detail">Element</a></li> |
| </ul> |
| </div> |
| <a id="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </nav> |
| <p class="legalCopy"><small><p align="left">Copyright © 2018, 2020 Eclipse Foundation.<br>Use is subject to <a href="../../../resources/EFSL.html" target="_top">license terms</a>.</small></p> |
| </footer> |
| </body> |
| </html> |