简体   繁体   中英

calling the REST url with empty path param

Server: Wildfly 8

REST Packages: javax.ws.rs.*

While to try access the below rest service with http://localhost:8070/RestSample-war/rest/bean/getall/sam it works fine, but while try with empty path param as like http://localhost:8070/RestSample-war/rest/bean/getall/ , it throws below error

@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
  }
}

Error:

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:.*}")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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