All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.
@Path("rs")
@Stateless
public class AdditionService extends Application {
@Path("/add/")
public LocalSub getLocalSub(){
return new LocalSub();
}
}
@Singleton
public class LocalSub implements LocalAddition {
public String getAddition(@PathParam("num1") int num, @PathParam("num2") int num2){
return "" + (num+num2);
}
}
@Local
public interface LocalAddition {
@GET
@Path("{num1}/{num2}")
public String getAddition(int num, int num2);
}
Please clarify whether this option is correct or wrong.
The @GET & @Path annotations on LocalAddition.getAddition is not inherited by LocalSub.getAddition and it would require its own request method designator since it provides additional @PathParam annotation.
You are right, the first option needs an explanation. The declaration is correct although as you mention annotation inheritance won't work here. I have added that to the explanation.