You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2019/07/11 09:46:47 UTC

[servicecomb-website] branch asf-site updated (f2169b2 -> c2ecea7)

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

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


    from f2169b2  Publish the website
     add 2d7d644  修改错误答案
     new dc9d4cb  Merge branch 'master' into asf-site
     new c2ecea7  publish the website

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 _faqs/cn/faq.md            | 14 ++------------
 content/cn/faqs/index.html | 13 +------------
 content/feed.xml           |  2 +-
 3 files changed, 4 insertions(+), 25 deletions(-)


[servicecomb-website] 02/02: publish the website

Posted by ni...@apache.org.
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 <wi...@gmail.com>
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;
 


[servicecomb-website] 01/02: Merge branch 'master' into asf-site

Posted by ni...@apache.org.
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 dc9d4cb270bf585b855c1b741d0e9c98ef1302f8
Merge: f2169b2 2d7d644
Author: Willem Jiang <wi...@gmail.com>
AuthorDate: Thu Jul 11 17:44:00 2019 +0800

    Merge branch 'master' into asf-site

 _faqs/cn/faq.md | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)