繁体   English   中英

用空路径参数调用REST URL

[英]calling the REST url with empty path param

服务器:Wildfly 8

REST软件包:javax.ws.rs。*

尝试使用http://localhost:8070/RestSample-war/rest/bean/getall/sam访问以下rest服务时,它可以正常工作,但是尝试使用空路径参数时,例如http://localhost:8070/RestSample-war/rest/bean/getall/ ,它抛出以下错误

@GET
@Path("getall/{name: .*}")
@Produces("application/json")
public Object Getall(@PathParam("name") String customerName) {
  if(customerName !=null){
      //return specific customer detail
  }else{
     //return all customer detail
  }
}

错误:

17:18:04,637 WARN  [org.jboss.resteasy.core.ExceptionHandler] (default task-37) 
failed to execute: javax.ws.rs.NotFoundException: Could not find resource for 
full path: http://localhost:8070/RestSample-war/rest/bean/getall/

能请您删除空白吗

@Path("getall/{name:.*}")

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM