Page 1 of 1

About Question enthuware.ocejws.v6.2.202 :

Posted: Sun Feb 09, 2014 9:58 pm
by sathishkumar

Code: Select all

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

Re: About Question enthuware.ocejws.v6.2.202 :

Posted: Mon Feb 10, 2014 12:50 am
by fjwalraven
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.

Thanks for your feedback!

Regards,
Frits