You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2019/08/23 20:56:47 UTC
svn commit: r1049225 - in /websites/production/cxf/content:
cache/docs.pageCache docs/jax-rs-advanced-features.html
Author: buildbot
Date: Fri Aug 23 20:56:47 2019
New Revision: 1049225
Log:
Production update by buildbot for cxf
Modified:
websites/production/cxf/content/cache/docs.pageCache
websites/production/cxf/content/docs/jax-rs-advanced-features.html
Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/cxf/content/docs/jax-rs-advanced-features.html
==============================================================================
--- websites/production/cxf/content/docs/jax-rs-advanced-features.html (original)
+++ websites/production/cxf/content/docs/jax-rs-advanced-features.html Fri Aug 23 20:56:47 2019
@@ -113,15 +113,17 @@ Apache CXF -- JAX-RS Advanced Features
<br clear="none"></p><p><br clear="none"></p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1557334569731 {padding: 0px;}
-div.rbtoc1557334569731 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1557334569731 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1566593768324 {padding: 0px;}
+div.rbtoc1566593768324 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1566593768324 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1557334569731">
+/*]]>*/</style></p><div class="toc-macro rbtoc1566593768324">
<ul class="toc-indentation"><li><a shape="rect" href="#JAX-RSAdvancedFeatures-JMSSupport">JMS Support</a>
<ul class="toc-indentation"><li><a shape="rect" href="#JAX-RSAdvancedFeatures-Endpoints">Endpoints</a></li><li><a shape="rect" href="#JAX-RSAdvancedFeatures-Client">Client</a></li></ul>
</li><li><a shape="rect" href="#JAX-RSAdvancedFeatures-AdvancedSearch">Advanced Search</a></li><li><a shape="rect" href="#JAX-RSAdvancedFeatures-Onewayinvocations">Oneway invocations</a></li><li><a shape="rect" href="#JAX-RSAdvancedFeatures-SupportforContinuations">Support for Continuations</a></li><li><a shape="rect" href="#JAX-RSAdvancedFeatures-Client-sidecaching">Client-side caching</a></li><li><a shape="rect" href="#JAX-RSAdvancedFeatures-Server-sidecaching">Server-side caching</a></li><li><a shape="rect" href="#JAX-RSAdvancedFeatures-RESTfulserviceswithoutannotations">RESTful services without annotations</a>
<ul class="toc-indentation"><li><a shape="rect" href="#JAX-RSAdvancedFeatures-Configuration">Configuration</a></li></ul>
+</li><li><a shape="rect" href="#JAX-RSAdvancedFeatures-QueryStringCustomization">Query String Customization</a>
+<ul class="toc-indentation"><li><a shape="rect" href="#JAX-RSAdvancedFeatures-Collection/List">Collection/List</a></li></ul>
</li></ul>
</div><h1 id="JAX-RSAdvancedFeatures-JMSSupport">JMS Support</h1><p>CXF has been designed such that multiple transports can be supported for a given endpoint. CXF JAX-RS endpoint and proxies can optionally support the JMS transport.</p><h2 id="JAX-RSAdvancedFeatures-Endpoints">Endpoints</h2><p>If you would like your JAXRS endpoint be capable of serving not only HTTP but also JMS requests then you need to specify a JMS transportId, example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default"><jaxrs:server serviceName="s:BookService" transportId="http://cxf.apache.org/transports/jms" address="/">
@@ -269,7 +271,21 @@ BookStoreNoAnnotations proxy = cf.create
sf.create();
}
} </pre>
-</div></div></div>
+</div></div><h1 class="auto-cursor-target" id="JAX-RSAdvancedFeatures-QueryStringCustomization">Query String Customization</h1><p>CXF provides advanced capabilities with respect to query string parsing and expansion.</p><h2 id="JAX-RSAdvancedFeatures-Collection/List">Collection/List</h2><p>The typical way to manage collection/list query parameters is described in <a shape="rect" class="external-link" href="https://tools.ietf.org/html/rfc6570" rel="nofollow">RFC-6570: URI Template</a> (<a shape="rect" class="external-link" href="https://tools.ietf.org/html/rfc6570" rel="nofollow">https://tools.ietf.org/html/rfc6570</a>) and basically assumes the repetition of the name/value pairs, for example: <a shape="rect" class="external-link" rel="nofollow" title="Follow link" href="http://localhost:8080/MovieDB/GetJson?name=Actor1,Actor2,Actor3&startDate=20120101&endDate=20120505">http://localhost:8080/MovieDB/GetJson?name=Actor1&name=Actor2&name=Actor3&startDate=20120101&am
p;endDate=2012050</a></p><p>Since <strong>3.1.8+</strong>, this behavior could be tweaked using server-side <strong>"parse.query.value.as.collection"</strong> property,  which adds support for collection/list parameters passed as comma-separated values, , for example: <a shape="rect" class="external-link" href="http://localhost:8080/MovieDB/GetJson?name=Actor1,Actor2,Actor3&startDate=20120101&endDate=20120505" title="Follow link" rel="nofollow">http://localhost:8080/MovieDB/GetJson?name=Actor1,Actor2,Actor3&startDate=20120101&endDate=2012050</a></p><p>The client support was lacking and was added in <strong>3.3.4 / 3.2.11 / 3.4.0 </strong>for all types of the clients (WebClient, JAX-RS Client Proxy and Microprofile Client). The matching property name is <strong>"expand.query.value.as.collection" </strong>and could be specified during the client instance creation, for example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelC
ontent pdl">
+<pre class="brush: java; gutter: false; theme: Default">MyClient client = JAXRSClientFactory
+ .create("http://localhost:8080", MyClient.class,
+ Collections.singletonMap("expand.query.value.as.collection", "true"));</pre>
+</div></div><p><br clear="none"></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">WebClient client = WebClient.create("http://localhost:8080",
+ Collections.singletonMap("expand.query.value.as.collection", "true"));</pre>
+</div></div><p><br clear="none"></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">MyClient client = RestClientBuilder
+ .newBuilder()
+ .property("expand.query.value.as.collection", "true")
+ .baseUri(new URI("http://localhost:8080"))
+ .build(MyClient.class);
+</pre>
+</div></div><p><br clear="none"></p><p><br clear="none"></p></div>
</div>
<!-- Content -->
</td>