-1
我是java的新手,JAX-RS.i已經開發了簡單應用程序的工作示例。使用Java減少URI的路徑(JAX-RS)
現在我想在RESTFul中減少我的網址。
目前我有http://localhost:8084/eshipper_api/apis/api/get_quote
此網址。
其工作並給出輸出。
我想,以減少它,並希望使它像http://localhost:8084/eshipper_api/apis/get_quote
我的web.xml
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<servlet>
<servlet-name>Eshipper API Application</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.eshipper.client.request</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>Eshipper API Application</servlet-name>
<url-pattern>/apis/*</url-pattern>
</servlet-mapping>
</web-app>
守則/JAVA/COM/eshipper /客戶機/ request/RequestHandler.java這是參數值爲com.eshipper.client.request
@Path("api")
public class RequestHandler
{
@GET
@Path("/get_quote")
public String GetQuote()
{
return "GOdddd Working";
}
}
請幫我這個。 在此先感謝。