Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Without any explicit details about the uriInfo object I can only speculate its type is the JAX-RS UriInfo class.</p> <p>The first line can be broken down as below:</p> <blockquote> <p>java.net.URI uri = uriInfo.<strong>getAbsolutePathBuilder</strong>().path(id).build();</p> </blockquote> <p>The getAbsolutePathBuilder is documented <a href="http://jackson.codehaus.org/javadoc/jax-rs/1.0/javax/ws/rs/core/UriInfo.html#getAbsolutePathBuilder%28%29" rel="nofollow">http://jackson.codehaus.org/javadoc/jax-rs/1.0/javax/ws/rs/core/UriInfo.html#getAbsolutePathBuilder%28%29</a> </p> <blockquote> <p>java.net.URI uri = uriInfo.getAbsolutePathBuilder().<strong>path(id)</strong>.build();</p> </blockquote> <p>The method returns a UriBuilder object. On which the 'path(...)' method is called passing the id so if the absolute path returned <a href="http://www.host.com" rel="nofollow">http://www.host.com</a> (this may or may not have a port number) adding the id in this method will then result in the effectively Builder holding the two parts. The base URI and the path. The two values have not yet been put together</p> <p>The build method then concatenates the two values resulting a full URI. For example <a href="http://www.google.com/id" rel="nofollow">http://www.google.com/id</a> (Where <a href="http://www.google.com" rel="nofollow">http://www.google.com</a> is the absolute path)</p> <p>The second line </p> <blockquote> <p>Response.created(uri).build();</p> </blockquote> <p>Is basically saying 'Respond with a created (201) response code, and set a Location header containing the build uri value'</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload