Rav*_*hra 11 java web-services jax-rs restful-url
我有像这样的网络服务
@GET
@Produces("application/json")
@Path("{parameter1}/july/{param2},{param3},{param4}/month")
public Month getResult(@PathParam("parameter1") String parameter1, @PathParam("param2") PathSegment param2 , @PathParam("param3") PathSegment param3, @PathParam("param4") PathSegment param4) {
return action.getResult(parameter1, new Integer(param2.getPath()), new Integer(param3.getPath()), new Integer(param3.getPath()));
}
Run Code Online (Sandbox Code Playgroud)
如果我从我的测试类中调用此Web服务,它可以正常工作; 但如果我通过浏览器调用它,我会收到消息,因为找不到该服务.
我通过浏览器使用的网址是
HTTP://本地主机:8080/Web应用程序/服务/座椅/ mylogin /月/ 1,0,0 /月
如果我使用网址作为
HTTP://本地主机:8080/Web应用程序/服务/座椅/ mylogin /飞/ 1/0/0 /月
并相应地更改服务中的路径它工作正常,但要求是使用逗号而不是斜杠.我们有什么方法可以在网址中使用带逗号分隔参数的web服务?