「 http://server:8080/application/service/customer/v1 」のような REST Web サービス URLを CreateCustomerBean クラスの createCustomer メソッドにマップする必要があります。
私は次のマッピングを行いました..
*Web.xml*
<servlet-mapping>
<servlet-name>RestiveServlet</servlet-name>
<url-pattern>/service/*</url-pattern>
</servlet-mapping>
*Rest-Config.xml*
<jaxrs:server address="/customer/"
<jaxrs:serviceBean>
<ref bean="CreateCustomerBean"/>
</jaxrs:serviceBean>
</jaxrs:server>
ここで問題は、url の残りのパス (" http://server:8080/application/service/customer/v1 ") が v1 残りのすべてがマップされていることです。CreateCustomerBean クラス レベルで 2 つの @Path 属性を指定する必要があります。そして、そのBeanのcreateCustomerメソッドに1つ..そのため、v1の前に「作成」を追加する必要があり、URLは次のようになります
@パス (/作成/)
CreateCustomerBean{
@パス(/v1)
createClient(文字列リクエスト){ }
}
http://server:8080/application/service/customer/create/v1/したくない..クラスレベルで @Path 属性を回避し、すべてのリクエストを createCustomer メソッドに送信する方法はありますか。