cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r995950 - in /websites/production/cxf/content: cache/docs.pageCache docs/jax-rs-basics.html docs/jaxrs-services-configuration.html
Date Fri, 26 Aug 2016 09:47:37 GMT
Author: buildbot
Date: Fri Aug 26 09:47:37 2016
New Revision: 995950

Log:
Production update by buildbot for cxf

Modified:
    websites/production/cxf/content/cache/docs.pageCache
    websites/production/cxf/content/docs/jax-rs-basics.html
    websites/production/cxf/content/docs/jaxrs-services-configuration.html

Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/cxf/content/docs/jax-rs-basics.html
==============================================================================
--- websites/production/cxf/content/docs/jax-rs-basics.html (original)
+++ websites/production/cxf/content/docs/jax-rs-basics.html Fri Aug 26 09:47:37 2016
@@ -118,11 +118,11 @@ Apache CXF -- JAX-RS Basics
            <!-- Content -->
            <div class="wiki-content">
 <div id="ConfluenceContent"><p><span class="inline-first-p" style="font-size:2em;font-weight:bold">JAX-RS
: Understanding the Basics</span>&#160;</p><p>&#160;</p><p><style
type="text/css">/*<![CDATA[*/
-div.rbtoc1436103991545 {padding: 0px;}
-div.rbtoc1436103991545 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1436103991545 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1472204820621 {padding: 0px;}
+div.rbtoc1472204820621 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1472204820621 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1436103991545">
+/*]]>*/</style></p><div class="toc-macro rbtoc1472204820621">
 <ul class="toc-indentation"><li><a shape="rect" href="#JAX-RSBasics-WhatisNewinJAX-RS2.0">What
is New in JAX-RS 2.0</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#JAX-RSBasics-Filters">Filters</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#JAX-RSBasics-Server">Server</a></li><li><a
shape="rect" href="#JAX-RSBasics-Client">Client</a></li></ul>
@@ -308,7 +308,11 @@ public class CustomerService {
     }
 }
 </pre>
-</div></div><p>This allows for throwing a checked or runtime exception
from an application code and map it to an HTTP response in a registered provider.</p><p>Have
a look please at <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecurityExceptionMapper.java">this
exception mapper</a> which converts Spring Security exceptions into HTTP 403 error code
for another example.</p><p>Note that when no mappers are found for custom exceptions,
they are propagated to the underlying container as required by the specification where they
will typically be wrapped in ServlerException, eventually resulting in HTTP 500 status being
returned by default. Thus one option for intercepting the exceptions is to register a custom
servlet filter which will catch ServletExceptions and handle the causes.</p><p>This
propagation can be disabled by registering a boolean jaxrs property 'org.apache.cxf.propagat
 e.exception' with a false value. If such property is set and no exception mapper can be found
for a given exception then it will be wrapped into an xml error response by the CXF <a
shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLFaultOutInterceptor.java">XMLFaultOutInterceptor</a>.</p><p>One
can also register a custom CXF out fault interceptor which can handle all the exceptions by
writing directly to the HttpServletResponse stream or XMLStreamWriter (as XMLFaultOutInterceptor
does). For example, see this <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomOutFaultInterceptor.java">test
interceptor</a>.</p><h2 id="JAX-RSBasics-MappingexceptionsthrownfromCXFinterceptors">Mapping
exceptions thrown from CXF interceptors</h2><p>Starting from CXF 2.7.8 it is also
possible to use registe
 red ExceptionMappers to map the exceptions thrown from CXF server in interceptors which are
registered after JAXRSInInterceptor (Phase.UNMARSHAL) and out interceptors registered before
JAXRSOutInterceptor (Phase.MARSHAL).<br clear="none"> In earlier CXF versions such exceptions
are only possible to handle with CXF fault in interceptors.</p><p>In order to
get the exceptions thrown from CXF in interceptors mapped, set a "map.cxf.interceptor.fault"
contextual property to true - needed in CXF 2.7.8 to ensure existing in fault interceptors
are not affected; the mapping is done by default starting from CXF 3.0.0.</p><p>In
order to get the exceptions thrown from CXF out interceptors mapped, add org.apache.cxf.jaxrs.interceptor.JAXRSOutExceptionMapperInterceptor
to the list of out interceptors.</p><h2 id="JAX-RSBasics-CustomizingdefaultWebApplicationExceptionmapper">Customizing
default WebApplicationException mapper</h2><p>CXF ships a WebApplicationException
mapper, org.apache.cxf.jaxrs.imp
 l.WebApplicationExceptionMapper. By default it logs a stack trace at a warning level and
returns Response available in the captured exception.<br clear="none"> It can be configured
to log a stack trace at a trace level, by setting a 'printStackTrace' property to 'false'.
Alternatively, if org.apache.cxf.logging.FaultListener is registered (as a contextual property)
and indicates that it handled a given exception, then no more logging is done.</p><p>A
simple text error message can also be optionally reported, by setting an 'addMessageToResponse'
property to 'true'.<br clear="none"> Note that the custom WebApplicationException mapper,
if registered, will be preferred to the default one.</p><h1 id="JAX-RSBasics-DealingwithParameters">Dealing
with Parameters</h1><p>PathParam annotation is used to map a given Path template
variable to a method parameter.<br clear="none"> For example :</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>This allows for throwing a checked or runtime exception
from an application code and map it to an HTTP response in a registered provider.</p><p>Have
a look please at <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/security/SecurityExceptionMapper.java">this
exception mapper</a> which converts Spring Security exceptions into HTTP 403 error code
for another example.</p><p>Note that when no mappers are found for custom exceptions,
they are propagated to the underlying container as required by the specification where they
will typically be wrapped in ServlerException, eventually resulting in HTTP 500 status being
returned by default. Thus one option for intercepting the exceptions is to register a custom
servlet filter which will catch ServletExceptions and handle the causes.</p><p>This
propagation can be disabled by registering a boolean jaxrs property 'org.apache.cxf.propagat
 e.exception' with a false value. If such property is set and no exception mapper can be found
for a given exception then it will be wrapped into an xml error response by the CXF <a
shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/interceptor/XMLFaultOutInterceptor.java">XMLFaultOutInterceptor</a>.</p><p>One
can also register a custom CXF out fault interceptor which can handle all the exceptions by
writing directly to the HttpServletResponse stream or XMLStreamWriter (as XMLFaultOutInterceptor
does). For example, see this <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomOutFaultInterceptor.java">test
interceptor</a>.</p><h2 id="JAX-RSBasics-MappingexceptionsthrownfromCXFinterceptors">Mapping
exceptions thrown from CXF interceptors</h2><p>Starting from CXF 2.7.8 it is also
possible to use registe
 red ExceptionMappers to map the exceptions thrown from CXF server in interceptors which are
registered after JAXRSInInterceptor (Phase.UNMARSHAL) and out interceptors registered before
JAXRSOutInterceptor (Phase.MARSHAL).<br clear="none"> In earlier CXF versions such exceptions
are only possible to handle with CXF fault in interceptors.</p><p>In order to
get the exceptions thrown from CXF in interceptors mapped, set a "map.cxf.interceptor.fault"
contextual property to true - needed in CXF 2.7.8 to ensure existing in fault interceptors
are not affected; the mapping is done by default starting from CXF 3.0.0.</p><p>In
order to get the exceptions thrown from CXF out interceptors mapped, add org.apache.cxf.jaxrs.interceptor.JAXRSOutExceptionMapperInterceptor
to the list of out interceptors.</p><h2 id="JAX-RSBasics-CustomizingdefaultWebApplicationExceptionmapper">Customizing
default WebApplicationException mapper</h2><p>CXF ships a WebApplicationException
mapper, org.apache.cxf.jaxrs.imp
 l.WebApplicationExceptionMapper. By default it logs a stack trace at a warning level and
returns Response available in the captured exception.<br clear="none"> It can be configured
to log a stack trace at a trace level, by setting a 'printStackTrace' property to 'false'.
Alternatively, if org.apache.cxf.logging.FaultListener is registered (as a contextual property)
and indicates that it handled a given exception, then no more logging is done.</p><p>A
simple text error message can also be optionally reported, by setting an 'addMessageToResponse'
property to 'true', example:</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">&lt;bean
id="exceptionMapper" class="org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper"&gt;
+   &lt;property name="addMessageToResponse" value="true" /&gt;
+&lt;/bean&gt;</pre>
+</div></div><p><br clear="none"> Note that the custom WebApplicationException
mapper, if registered, will be preferred to the default one.</p><h1 id="JAX-RSBasics-DealingwithParameters">Dealing
with Parameters</h1><p>PathParam annotation is used to map a given Path template
variable to a method parameter.<br clear="none"> For example :</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
 <pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">@Path("/customer/{id}")
 public class CustomerService {
 

Modified: websites/production/cxf/content/docs/jaxrs-services-configuration.html
==============================================================================
--- websites/production/cxf/content/docs/jaxrs-services-configuration.html (original)
+++ websites/production/cxf/content/docs/jaxrs-services-configuration.html Fri Aug 26 09:47:37
2016
@@ -118,11 +118,11 @@ Apache CXF -- JAXRS Services Configurati
            <!-- Content -->
            <div class="wiki-content">
 <div id="ConfluenceContent"><p>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;<span
class="inline-first-p" style="font-size:2em;font-weight:bold">JAX-RS : Services Configuration</span>&#160;</p><p>&#160;</p><p>&#160;</p><p>&#160;</p><p><style
type="text/css">/*<![CDATA[*/
-div.rbtoc1467906414827 {padding: 0px;}
-div.rbtoc1467906414827 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1467906414827 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1472204821787 {padding: 0px;}
+div.rbtoc1472204821787 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1472204821787 li {margin-left: 0px;padding-left: 0px;}
 
-/*]]>*/</style></p><div class="toc-macro rbtoc1467906414827">
+/*]]>*/</style></p><div class="toc-macro rbtoc1472204821787">
 <ul class="toc-indentation"><li><a shape="rect" href="#JAXRSServicesConfiguration-ConfiguringJAX-RSservicesprogrammatically">Configuring
JAX-RS services programmatically</a></li><li><a shape="rect" href="#JAXRSServicesConfiguration-OSGI">OSGI</a>
 <ul class="toc-indentation"><li><a shape="rect" href="#JAXRSServicesConfiguration-Blueprint">Blueprint</a></li><li><a
shape="rect" href="#JAXRSServicesConfiguration-Spring">Spring</a></li></ul>
 </li><li><a shape="rect" href="#JAXRSServicesConfiguration-SpringBoot">Spring
Boot</a></li><li><a shape="rect" href="#JAXRSServicesConfiguration-ConfiguringJAX-RSendpointsprogrammaticallywithoutSpring">Configuring
JAX-RS endpoints programmatically without Spring</a></li><li><a shape="rect"
href="#JAXRSServicesConfiguration-BlueprintWeb">Blueprint Web</a>
@@ -732,7 +732,7 @@ sf.setResourceProvider(new PerRequestRes
   
   &lt;cxf:bus&gt;
         &lt;cxf:properties&gt;
-            &lt;entry key="javax.ws.rs.ext.ExceptionMapper" ref="exceptionMapper"/&gt;
+            &lt;entry key="javax.ws.rs.ext.ExceptionMapper" value-ref="exceptionMapper"/&gt;
         &lt;/cxf:properties&gt;
   &lt;/cxf:bus
 
@@ -757,7 +757,7 @@ sf.setResourceProvider(new PerRequestRes
   
   &lt;cxf:bus&gt;
         &lt;cxf:properties&gt;
-            &lt;entry key="org.apache.cxf.jaxrs.bus.providers" ref="busProviders"/&gt;
+            &lt;entry key="org.apache.cxf.jaxrs.bus.providers" value-ref="busProviders"/&gt;
         &lt;/cxf:properties&gt;
   &lt;/cxf:bus
 



Mime
View raw message