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

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


The following commit(s) were added to refs/heads/master by this push:
     new d1ef812  Add Notes for providers and fix FAQ mistakes (#77)
d1ef812 is described below

commit d1ef812efae6724b76bd40dd6ab2b150e5f438f2
Author: zhengyangyong <yangyong.zh...@huawei.com>
AuthorDate: Mon May 7 09:32:36 2018 +0800

    Add Notes for providers and fix FAQ mistakes (#77)
    
    * fix url of publishing mistakes
    
    Signed-off-by: zhengyangyong <yangyong.zh...@huawei.com>
    
    * fix mistakes
    
    Signed-off-by: zhengyangyong <yangyong.zh...@huawei.com>
    
    * fix pr comment
    
    Signed-off-by: zhengyangyong <yangyong.zh...@huawei.com>
---
 _faqs/cn/faq.md                              | 28 ++++++----------------------
 _users/cn/develop-with-jax-rs.md             |  4 ++++
 _users/cn/develop-with-springboot-starter.md |  4 ++++
 _users/cn/develop-with-springmvc.md          |  4 ++++
 _users/cn/develop-with-transparent-rpc.md    | 15 +++++++++++++--
 _users/develop-with-jax-rs.md                |  4 ++++
 _users/develop-with-springboot-starter.md    |  4 ++++
 _users/develop-with-springmvc.md             |  4 ++++
 _users/develop-with-transparent-rpc.md       | 15 +++++++++++++--
 9 files changed, 56 insertions(+), 26 deletions(-)

diff --git a/_faqs/cn/faq.md b/_faqs/cn/faq.md
index 43533c4..b862864 100755
--- a/_faqs/cn/faq.md
+++ b/_faqs/cn/faq.md
@@ -50,29 +50,13 @@ redirect_from:
 
    A: 
可以,具体可以参考java-chassis的[integration-test的实现](https://github.com/apache/incubator-servicecomb-java-chassis/blob/master/integration-tests/springmvc-tests/src/test/java/org/apache/servicecomb/demo/springmvc/tests/SpringMvcIntegrationTestBase.java)。
 
-* **Q: 微服务启动后,无法正确调用接口,使用的代码为:**
+* **Q: 微服务启动后,无法正确调用接口,或返回不存在错误?**
 
-   ```java
-   @RestController
-   @RestSchema(schemaId = "worker")
-   public class WorkerController {
-     @RequestMapping(value="/count", method=RequestMethod.GET)
-     public int getWorkerNumbers() {
-       ...
-     }
-   }
-   ```
-
-   A: 
在没有指明根路径的情况下,默认会使用类名作为其根路径,即上述代码中可访问的路径应为`/WorkerController/count`。如果想要实现`/count`这样的访问,则要指明根路径:
-
-   ```java
-   @RequestMapping(value = "/")
-   public class WorkerController {}
-   ```
-
-* **Q: 如果没有指定RequestMapping这个标注的value时,默认的基本路径是什么?**
-
-   A: 假设你的Controller类名为*HelloController*,那么基本路径就是/HelloController。
+   A: 请检查调用路径与Producer实现代码中发布的路径完全一致。Producer端的启动日志可以查看到映射路径输出,例如:
+   
+   `[INFO] Swagger mapped "{[/hello/], method=[GET], 
produces=[application/json]}"`
+   
+   不同编程风格(模型)实现Producer的文档和注意事项请参见:[Jaxrs](/cn/users/develop-with-jax-rs/) 
[SpringMVC](/cn/users/develop-with-springmvc/) 
[Pojo](/cn/users/develop-with-transparent-rpc/) [Spring 
Boot](/cn/users/develop-with-spring-boot-starter/) 。
 
 * **Q: 在eclipse下修改了microservice.yaml配置文件下的端口号,启动程序后,端口号没生效?**
 
diff --git a/_users/cn/develop-with-jax-rs.md b/_users/cn/develop-with-jax-rs.md
index 9314031..8ae792f 100644
--- a/_users/cn/develop-with-jax-rs.md
+++ b/_users/cn/develop-with-jax-rs.md
@@ -80,6 +80,10 @@ ServiceComb支持开发者使用JAX-RS注解,使用JAX-RS模式开发服务。
      }
    }
    ```
+   
+   **注意:请一定在服务的实现类(本文档例子为JaxrsHelloImpl)上标记@Path,否则接口发布的Path和Method将会不正确!**
+   
+   
本例sayHi的访问Path为`/jaxrshello/sayhi`,sayHello的访问Path为`/jaxrshello/sayhello`,如果希望他们的访问路径为`/sayhi`和`/sayhello`,直接设置JaxrsHelloImpl上的`@Path`为`@Path("/")`。
 
 * **步骤 3** 发布服务。
 
diff --git a/_users/cn/develop-with-springboot-starter.md 
b/_users/cn/develop-with-springboot-starter.md
index b4d33e1..ecfb556 100644
--- a/_users/cn/develop-with-springboot-starter.md
+++ b/_users/cn/develop-with-springboot-starter.md
@@ -76,6 +76,10 @@ Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来
     }
    }
    ```
+   
+   
**注意:请一定在服务的实现类(本文档例子为SpringmvcHelloImpl)上标记@RequestMapping,否则接口发布的Path和Method将会不正确!**
+         
+   
本例sayHi的访问Path为`/springmvchello/sayhi`,sayHello的访问Path为`/springmvchello/sayhello`,如果希望他们的访问路径为`/sayhi`和`/sayhello`,直接设置SpringmvcHelloImpl上的`@RequestMapping`为`@RequestMapping(path
 = "/")`。
 
 * **步骤 3** 发布服务
 
diff --git a/_users/cn/develop-with-springmvc.md 
b/_users/cn/develop-with-springmvc.md
index 9a1c94f..d422b7f 100644
--- a/_users/cn/develop-with-springmvc.md
+++ b/_users/cn/develop-with-springmvc.md
@@ -77,6 +77,10 @@ ServiceComb支持SpringMVC注解,允许使用SpringMVC风格开发微服务。
     }
    }
    ```
+   
+   
**注意:请一定在服务的实现类(本文档例子为SpringmvcHelloImpl)上标记@RequestMapping,否则接口发布的Path和Method将会不正确!**
+      
+   
本例sayHi的访问Path为`/springmvchello/sayhi`,sayHello的访问Path为`/springmvchello/sayhello`,如果希望他们的访问路径为`/sayhi`和`/sayhello`,直接设置SpringmvcHelloImpl上的`@RequestMapping`为`@RequestMapping(path
 = "/")`。
 
 * **步骤 3** 发布服务
 
diff --git a/_users/cn/develop-with-transparent-rpc.md 
b/_users/cn/develop-with-transparent-rpc.md
index ac0f2b8..b18ef66 100644
--- a/_users/cn/develop-with-transparent-rpc.md
+++ b/_users/cn/develop-with-transparent-rpc.md
@@ -109,10 +109,17 @@ redirect_from:
 
    ```java
    import org.apache.servicecomb.provider.pojo.RpcSchema;
-   // other code omitted
    @RpcSchema(schemaId = "pojoHello")
    public class HelloImpl implements Hello {
-     // other code omitted
+      @Override
+      public String sayHi(String name) {
+        return "Hello " + name;
+      }
+ 
+      @Override
+      public String sayHello(Person person) {
+        return "Hello person " + person.getName();
+      }
    }
    ```
 
@@ -130,6 +137,10 @@ redirect_from:
    </beans>
    ```
 
+**注意:无论哪种发布模式,RPC发布的URL都为`ClassName/MethodName`,并且Method都为`POST`。**
+         
+本例sayHi的访问Path为`/HelloImpl/sayHi`,sayHello的访问Path为`/HelloImpl/sayHello`。
+
 > **说明**:
 与Spring MVC开发模式和JAX-RS开发模式不同的是,透明RPC开发模式使用的注解是`@RpcSchema`而非`@RestSchema`。
 
diff --git a/_users/develop-with-jax-rs.md b/_users/develop-with-jax-rs.md
index 95849a4..ef63847 100644
--- a/_users/develop-with-jax-rs.md
+++ b/_users/develop-with-jax-rs.md
@@ -77,6 +77,10 @@ ServiceComb supports developers in developing services in 
JAX-RS mode by using J
      }
    }
    ```
+   
+   **Note: PLEASE MAKE SURE TO MARK @Path ON YOUR PRODUCER(JaxrsHelloImpl), OR 
THE PATH AND METHOD OF PUBLISHED WILL BE INCORRECT!**
+   
+   In this sample the Path of sayHi is `/jaxrshello/sayhi`, and the Path of 
sayHello is `/jaxrshello/sayhello`, if you wish them `/sayhi` and `/sayhello`, 
please change the setting of `@Path` on the JaxrsHelloImpl to `@Path("/")`.
 
 * **Step 3** Release the service. Add ```@RestSchema``` as the annotation of 
the service implementation class and specify schemaID, which indicates that the 
implementation is released as a schema of the current microservice. The code is 
as follows:
 
diff --git a/_users/develop-with-springboot-starter.md 
b/_users/develop-with-springboot-starter.md
index 85c9ebb..2c9f0ee 100644
--- a/_users/develop-with-springboot-starter.md
+++ b/_users/develop-with-springboot-starter.md
@@ -71,6 +71,10 @@ You need to use the native Java Chassis framework to develop 
microservice applic
     }
    }
    ```
+   
+   **Note: PLEASE MAKE SURE TO MARK @RequestMapping ON YOUR 
PRODUCER(SpringmvcHelloImpl), OR THE PATH AND METHOD OF PUBLISHED WILL BE 
INCORRECT!**
+   
+   In this sample the Path of sayHi is `/springmvchello/sayhi`, and the Path 
of sayHello is `/springmvchello/sayhello`, if you wish them `/sayhi` and 
`/sayhello`, please change the setting of `@RequestMapping` on the 
SpringmvcHelloImpl to `@RequestMapping("/")`.
 
 * **Step 3** Release the service. Add @RestSchema as the annotation of the 
service implementation class and specify schemaId, which indicates that the 
implementation is released as a schema of the current microservice. The code is 
as follows:
 
diff --git a/_users/develop-with-springmvc.md b/_users/develop-with-springmvc.md
index 900b89f..8a54920 100644
--- a/_users/develop-with-springmvc.md
+++ b/_users/develop-with-springmvc.md
@@ -74,6 +74,10 @@ ServiceComb supports Spring MVC remark and allows you to 
develop microservices i
     }
    }
    ```
+   
+   **Note: PLEASE MAKE SURE TO MARK @RequestMapping ON YOUR 
PRODUCER(SpringmvcHelloImpl), OR THE PATH AND METHOD OF PUBLISHED WILL BE 
INCORRECT!**
+   
+   In this sample the Path of sayHi is `/springmvchello/sayhi`, and the Path 
of sayHello is `/springmvchello/sayhello`, if you wish them `/sayhi` and 
`/sayhello`, please change the setting of `@RequestMapping` on the 
SpringmvcHelloImpl to `@RequestMapping("/")`.
 
 * **Step 3** Release the service. Add @RestSchema as the annotation of the 
service implementation class and specify schemaId, which indicates that the 
implementation is released as a schema of the current microservice. The code is 
as follows:
 
diff --git a/_users/develop-with-transparent-rpc.md 
b/_users/develop-with-transparent-rpc.md
index 9a80e4a..a736fa1 100644
--- a/_users/develop-with-transparent-rpc.md
+++ b/_users/develop-with-transparent-rpc.md
@@ -101,10 +101,17 @@ The transparent remote procedure call(RPC) development 
mode is a development mod
 
    ```java
    import org.apache.servicecomb.provider.pojo.RpcSchema;
-   // other code omitted
    @RpcSchema(schemaId = "pojoHello")
    public class HelloImpl implements Hello {
-     // other code omitted
+      @Override
+      public String sayHi(String name) {
+        return "Hello " + name;
+      }
+ 
+      @Override
+      public String sayHello(Person person) {
+        return "Hello person " + person.getName();
+      }
    }
    ```
 
@@ -122,6 +129,10 @@ The transparent remote procedure call(RPC) development 
mode is a development mod
    </beans>
    ```
 
+**Note: THE PATH FOR RPC IS `ClassName/MethodName`, AND THE METHOD IS `POST`.**
+
+In this sample the Path of sayHi is `/HelloImpl/sayHi`, and the Path of 
sayHello is `/HelloImpl/sayHello`.
+
 > **NOTE**:
 Different from the Spring MVC and JAX-RS development modes, the transparent 
RPC development mode used `@RpcSchema` instead of `@RestSchema`.
 

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.

Reply via email to