About Question enthuware.ocejws.v6.2.202 :

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.

Moderators: Site Manager, fjwalraven

Post Reply
sathishkumar
Posts: 5
Joined: Mon Jan 27, 2014 3:32 am
Contact:

About Question enthuware.ocejws.v6.2.202 :

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

fjwalraven
Posts: 429
Joined: Tue Jul 24, 2012 2:43 am
Contact:

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

Post 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

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest