S
S
sys_user2018-10-24 16:16:38
Java
sys_user, 2018-10-24 16:16:38

Can a method in a rest service not have @Path mapping?

There is a similar service:

@Path("/{Id}/main")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class test2 extends test1 {

    @POST
    @Path("/img")
    public String method1(@PathParam("Id") String Id, String action) {
        return service(getValue(Id), action);
    }

    @POST
    public String method2(@PathParam("Id") String Id) {
        return service2(getValue(Id));
    }
}

Can a method (method2) in a rest service not have a mapping @Path? Is it valid? If so, in what cases and how does it work in terms of mapping? I couldn't find an answer to this question on google.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question