Author: buildbot
Date: Tue Nov 22 15:42:53 2022
New Revision: 1081615
Log:
Production update by buildbot for cxf
Modified:
websites/production/cxf/content/cache/docs.pageCache
websites/production/cxf/content/docs/jax-rs-redirection.html
Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/cxf/content/docs/jax-rs-redirection.html
==============================================================================
--- websites/production/cxf/content/docs/jax-rs-redirection.html (original)
+++ websites/production/cxf/content/docs/jax-rs-redirection.html Tue Nov 22
15:42:53 2022
@@ -58,7 +58,7 @@ Apache CXF -- JAX-RS Redirection
<td id="cell-1-1"> </td>
<td id="cell-1-2">
<!-- Banner -->
-<div class="banner" id="banner"><div class="table-wrap"><table
class="confluenceTable" style="width: 100.0%;" border="0" cellpadding="0"
cellspacing="0"><colgroup span="1"><col span="1"><col
span="1"></colgroup><tbody><tr><td align="left" colspan="1" rowspan="1"
class="confluenceTd" style="border: none;"><a shape="rect"
href="http://cxf.apache.org/" title="Apache CXF"> <span style="color:
white;font-size: 170.0%;font-weight: bold;">Apache CXF</span> </a></td><td
align="right" colspan="1" rowspan="1" class="confluenceTd" style="border:
none;"><a shape="rect" class="external-link" href="http://www.apache.org/"
title="The Apache Software Foundation"> <span
class="confluence-embedded-file-wrapper image-right-wrapper
confluence-embedded-manual-size"><img class="confluence-embedded-image
confluence-external-resource image-right" alt="The Apache Software Foundation"
width="214" src="https://apache.org/img/asf_logo.png"
data-image-src="https://apache.org/img/asf_logo.png"></span> </a></td><
/tr></tbody></table></div></div>
+<div class="banner" id="banner"><div class="table-wrap"><table
class="confluenceTable" style="width: 100.0%;" border="0" cellpadding="0"
cellspacing="0"><colgroup span="1"><col span="1"><col
span="1"></colgroup><tbody><tr><td align="left" colspan="1" rowspan="1"
class="confluenceTd" style="border: none;"><a shape="rect"
href="http://cxf.apache.org/" title="Apache CXF"> <span style="color:
white;font-size: 170.0%;font-weight: bold;">Apache CXF</span> </a></td><td
align="right" colspan="1" rowspan="1" class="confluenceTd" style="border:
none;"><a shape="rect" class="external-link" href="http://www.apache.org/"
title="The Apache Software Foundation"> <span
class="confluence-embedded-file-wrapper image-right-wrapper
confluence-embedded-manual-size"><img class="confluence-embedded-image
confluence-external-resource image-right" draggable="false" alt="The Apache
Software Foundation" width="214" src="https://apache.org/img/asf_logo.png"
data-image-src="https://apache.org/img/asf_logo.png">
</span> </a></td></tr></tbody></table></div></div>
<!-- Banner -->
<div id="top-menu">
<table border="0" cellpadding="1" cellspacing="0" width="100%">
@@ -98,7 +98,7 @@ Apache CXF -- JAX-RS Redirection
<div id="navigation"><ul class="alternate"><li><a shape="rect"
href="overview.html">Overview</a></li><li><a shape="rect"
href="how-tos.html">How-Tos</a></li><li><a shape="rect"
href="frontends.html">Frontends</a></li><li><a shape="rect"
href="databindings.html">DataBindings</a></li><li><a shape="rect"
href="transports.html">Transports</a></li><li><a shape="rect"
href="configuration.html">Configuration</a></li><li><a shape="rect"
href="debugging-and-logging.html">Debugging and Logging</a></li><li><a
shape="rect" href="tools.html">Tools</a></li><li><a shape="rect"
href="restful-services.html">RESTful Services</a></li><li><a shape="rect"
href="wsdl-bindings.html">WSDL Bindings</a></li><li><a shape="rect"
href="service-routing.html">Service Routing</a></li><li><a shape="rect"
href="dynamic-languages.html">Dynamic Languages</a></li><li><a shape="rect"
href="ws-support.html">WS-* Support</a></li><li><a shape="rect"
href="advanced-integration.html">Advanced Integration</a></li><li><a shape
="rect" href="deployment.html">Deployment</a></li><li><a shape="rect"
href="schemas-and-namespaces.html">Use of Schemas and
Namespaces</a></li></ul><hr><ul
class="alternate"><li><p>Search</p></li></ul><iframe frameborder="1"
scrolling="auto" id="searchId"
src="https://cxf.apache.org/resources/search.htm" name="SearchIFrame"
width="200px" style="border:none;" title="Search" height="60px"><p><br
clear="none"></p></iframe>
-<hr><ul class="alternate"><li><a shape="rect"
href="http://cxf.apache.org/javadoc/latest-3.5.x/">API 3.5.x
(Javadoc)</a></li><li><a shape="rect"
href="http://cxf.apache.org/javadoc/latest-3.2.x/">API 3.2.x
(Javadoc)</a></li><li><a shape="rect"
href="http://cxf.apache.org/javadoc/latest-3.1.x/">API 3.1.x
(Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/">CXF
Website</a></li></ul><p><br clear="none"></p><p><a shape="rect"
class="external-link" href="https://www.apache.org/events/current-event.html">
<span class="confluence-embedded-file-wrapper"><img
class="confluence-embedded-image confluence-external-resource"
src="https://www.apache.org/events/current-event-125x125.png"
data-image-src="https://www.apache.org/events/current-event-125x125.png"></span>
</a></p></div>
+<hr><ul class="alternate"><li><a shape="rect"
href="http://cxf.apache.org/javadoc/latest-3.5.x/">API 3.5.x
(Javadoc)</a></li><li><a shape="rect"
href="http://cxf.apache.org/javadoc/latest-3.2.x/">API 3.2.x
(Javadoc)</a></li><li><a shape="rect"
href="http://cxf.apache.org/javadoc/latest-3.1.x/">API 3.1.x
(Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/">CXF
Website</a></li></ul><p><br clear="none"></p><p><a shape="rect"
class="external-link" href="https://www.apache.org/events/current-event.html">
<span class="confluence-embedded-file-wrapper"><img
class="confluence-embedded-image confluence-external-resource"
draggable="false" src="https://www.apache.org/events/current-event-125x125.png"
data-image-src="https://www.apache.org/events/current-event-125x125.png"></span>
</a></p></div>
<!-- NavigationBar -->
</div>
</div>
@@ -108,15 +108,15 @@ Apache CXF -- JAX-RS Redirection
<td height="100%">
<!-- Content -->
<div class="wiki-content">
-<div
id="ConfluenceContent"><p> </p><p> </p><p> </p><p> </p><p> <span
style="font-size:2em;font-weight:bold">JAX-RS : Redirection</span>
+<div id="ConfluenceContent"><p><br clear="none"><span
style="font-size:2em;font-weight:bold">JAX-RS : Redirection</span>
- </p><p> </p><p> </p><p> </p><p> </p><p><style
type="text/css">/*<![CDATA[*/
-div.rbtoc1651074259527 {padding: 0px;}
-div.rbtoc1651074259527 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1651074259527 li {margin-left: 0px;padding-left: 0px;}
+<br clear="none"></p><p><br clear="none"></p><p><style
type="text/css">/*<![CDATA[*/
+div.rbtoc1669131769170 {padding: 0px;}
+div.rbtoc1669131769170 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1669131769170 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1651074259527">
+/*]]>*/</style></p><div class="toc-macro rbtoc1669131769170">
<ul class="toc-indentation"><li><a shape="rect"
href="#JAXRSRedirection-WithRequestDispatcherProvider">With
RequestDispatcherProvider</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#JAXRSRedirection-Loggingredirects">Logging redirects</a></li></ul>
</li><li><a shape="rect" href="#JAXRSRedirection-WithCXFServlet">With
CXFServlet</a></li><li><a shape="rect"
href="#JAXRSRedirection-CustomRedirection">Custom Redirection</a></li></ul>
@@ -169,7 +169,7 @@ public Resource {
</bean>
</pre>
-</div></div><p>The above configuration says that a "book.jsp" resource will
handle an instance of Book by accessing it as a "book" attribute and a
"customer.jsp" - an instance of Customer by retrieving it as a "customer"
attribute. Note you don't need to use the "beanNames" property in such cases, a
simpler "beanName" property can do unless you have a single (jsp) resource
dealing with both Book and Customer.</p><p>Apart from making an instance of
response class available as HttpServletRequest attribute,
RequestDispatcherProvider will also make all the Path, Query and Matrix
parameters available as HttpServletRequest parameters (as opposed to
attributes) by default. For example, given the above code fragment, an
HttpServletRequest parameter named "id" representing a @PathParam("id")
available to the view handler, as well as all other query and matrix
parameters.<br clear="none"> Note that RequestDispatcherProvider can be
configured to save all these request parameters as HttpServlet
Request attributes by setting a boolean saveParametersAsAttributes property to
true.</p><p>Now, imagine a scenario like this: we have two resource methods
returning a ReservationStatus bean. The first method returns a successful
confirmation or uses Response.seeOther(...) to redirect to a method handling
the failed reservation. So both methods return the same ReservationStatus bean
but we will have two different views handling successful and failed
reservations respectively. Here is one way to manage it:</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>The above configuration says that a "book.jsp" resource will
handle an instance of Book by accessing it as a "book" attribute and a
"customer.jsp" - an instance of Customer by retrieving it as a "customer"
attribute. Note you don't need to use the "beanNames" property in such cases, a
simpler "beanName" property can do unless you have a single (jsp) resource
dealing with both Book and Customer.</p><p>Apart from making an instance of
response class available as HttpServletRequest attribute,
RequestDispatcherProvider will also make all the Path, Query and Matrix
parameters available as HttpServletRequest parameters (as opposed to
attributes) by default. For example, given the above code fragment, an
HttpServletRequest parameter named "id" representing a @PathParam("id")
available to the view handler, as well as all other query and matrix
parameters.<br clear="none">Note that RequestDispatcherProvider can be
configured to save all these request parameters as HttpServletR
equest attributes by setting a boolean saveParametersAsAttributes property to
true.</p><p>Now, imagine a scenario like this: we have two resource methods
returning a ReservationStatus bean. The first method returns a successful
confirmation or uses Response.seeOther(...) to redirect to a method handling
the failed reservation. So both methods return the same ReservationStatus bean
but we will have two different views handling successful and failed
reservations respectively. Here is one way to manage it:</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default"><bean
id="reserveRegistrationViews"
class="org.apache.cxf.jaxrs.provider.RequestDispatcherProvider">
<property name="resourcePaths">
<map>
@@ -180,7 +180,7 @@ public Resource {
<property name="beanName" value="data"/>
</bean>
</pre>
-</div></div><p>Given that the same ReservationStatus bean is returned in both
cases, it is actually the original request URI fragments which are used to
match which view handler will deal with a given ReservationStatus, example, a
response to request URI "http://localhost:8080/reservations/reserve/complete"
will be handled by "/forms/reservationConfirm.jsp".</p><p>Note that
RequestDispatcherProvider has a 'dispatcherName' property - that can be handy
when redirecting to named servlets (example, MyServlet) including<br
clear="none"> such ones as "jsp" or "default", especially when CXFServlet
handling a given invocation has a uri pattern (typically, wildcard) that may
also capture the redirection request, see the next section for more
information.</p><p>Next, imagine a scenario like this: we have a single
resource method accepting some data and the response view will need to be
different depending on the status of the request processing. Using enumerations
is the most effective option
in this case:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+</div></div><p>Given that the same ReservationStatus bean is returned in both
cases, it is actually the original request URI fragments which are used to
match which view handler will deal with a given ReservationStatus, example, a
response to request URI "http://localhost:8080/reservations/reserve/complete"
will be handled by "/forms/reservationConfirm.jsp".</p><p>Note that
RequestDispatcherProvider has a 'dispatcherName' property - that can be handy
when redirecting to named servlets (example, MyServlet) including<br
clear="none">such ones as "jsp" or "default", especially when CXFServlet
handling a given invocation has a uri pattern (typically, wildcard) that may
also capture the redirection request, see the next section for more
information.</p><p>Next, imagine a scenario like this: we have a single
resource method accepting some data and the response view will need to be
different depending on the status of the request processing. Using enumerations
is the most effective option
in this case:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default">package resource;
public class Status {