This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/servicecomb-website.git

commit c2ecea7cfdd298e933caa4bb2d6658e893f66779
Author: Willem Jiang <[email protected]>
AuthorDate: Thu Jul 11 17:46:27 2019 +0800

    publish the website
---
 content/cn/faqs/index.html | 13 +------------
 content/feed.xml           |  2 +-
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/content/cn/faqs/index.html b/content/cn/faqs/index.html
index d5cb52f..0c3c298 100644
--- a/content/cn/faqs/index.html
+++ b/content/cn/faqs/index.html
@@ -844,18 +844,7 @@
   <li>
     <p><strong>Q: 如何在用户自定义的handler中获取header中某个字段的值</strong></p>
 
-    <p>A: 
在用户自定义的handler使用@ApiImplicitParams注解声明,使用invocation.getArgs()获取header的值。例如:</p>
-
-    <div class="language-java highlighter-rouge"><pre 
class="highlight"><code><span class="kd">public</span> <span 
class="kd">class</span> <span class="nc">MyHandler</span> <span 
class="kd">implements</span> <span class="n">Handler</span> <span 
class="o">{</span>
-  <span class="nd">@ApiImplicitParams</span><span class="o">({</span><span 
class="nd">@ApiImplicitParam</span><span class="o">(</span><span 
class="n">name</span> <span class="o">=</span> <span 
class="s">"tester"</span><span class="o">,</span> <span 
class="n">dataType</span> <span class="o">=</span> <span 
class="s">"string"</span><span class="o">,</span> <span 
class="n">paramType</span> <span class="o">=</span> <span 
class="s">"header"</span><span class="o">)})</span>
-  <span class="nd">@Override</span>
-  <span class="kd">public</span> <span class="kt">void</span> <span 
class="nf">handle</span><span class="o">(</span><span 
class="n">Invocation</span> <span class="n">invocation</span><span 
class="o">,</span> <span class="n">AsyncResponse</span> <span 
class="n">asyncResp</span><span class="o">)</span> <span 
class="kd">throws</span> <span class="n">Exception</span> <span 
class="o">{</span>
-    <span class="n">Object</span><span class="o">[]</span> <span 
class="n">args</span> <span class="o">=</span> <span 
class="n">invocation</span><span class="o">.</span><span 
class="na">getArgs</span><span class="o">();</span>
-    <span class="n">System</span><span class="o">.</span><span 
class="na">out</span><span class="o">.</span><span 
class="na">println</span><span class="o">(</span><span 
class="n">args</span><span class="o">);</span>
-  <span class="o">}</span>
-<span class="o">}</span>
-</code></pre>
-    </div>
+    <p>A: 
Invocation.getArgs可以获取到接口定义里面声明的所有参数信息。在接口里面未定义的信息,比如额外的header,则需要通过InvocationContext来传递和获取。基本原理是实现HttpServerFilter将header设置到InvocationContext里面,然后在通过invocation.getContext获取。示例代码可以参考servicecomb-fence的
 <a 
href="https://github.com/apache/servicecomb-fence/tree/master/api/edge-service/endpoint/src/main/java/org/apache/servicecomb/authentication/edge";>AuthHandler
 和 AuthenticationFilter</a> 。</p>
   </li>
   <li>
     <p><strong>Q: 微服务运行时抛出异常:<code class="highlighter-rouge"> 
java.lang.Error:not support def type:calss io.swagger.models.properties 
BaseIntegerProperty</code>?</strong></p>
diff --git a/content/feed.xml b/content/feed.xml
index 7b389b3..1537498 100644
--- a/content/feed.xml
+++ b/content/feed.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?><feed 
xmlns="http://www.w3.org/2005/Atom"; ><generator uri="https://jekyllrb.com/"; 
version="3.4.3">Jekyll</generator><link href="/feed.xml" rel="self" 
type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" 
/><updated>2019-07-10T20:57:46+08:00</updated><id>/</id><title 
type="html">Apache ServiceComb</title><subtitle>The homepage of 
ServiceComb</subtitle><author><name>{&quot;name&quot;=&gt;nil, 
&quot;avatar&quot;=&gt;&quot;/assets [...]
+<?xml version="1.0" encoding="utf-8"?><feed 
xmlns="http://www.w3.org/2005/Atom"; ><generator uri="https://jekyllrb.com/"; 
version="3.4.3">Jekyll</generator><link href="/feed.xml" rel="self" 
type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" 
/><updated>2019-07-11T17:45:19+08:00</updated><id>/</id><title 
type="html">Apache ServiceComb</title><subtitle>The homepage of 
ServiceComb</subtitle><author><name>{&quot;name&quot;=&gt;nil, 
&quot;avatar&quot;=&gt;&quot;/assets [...]
 
 &lt;p&gt;基于微服务架构的应用相对于单体架构的应用而言在验收测试阶段具有以下挑战:&lt;/p&gt;
 

Reply via email to