About Question enthuware.ocejws.v6.2.194 :

Moderators: Site Manager, fjwalraven

Post Reply
Posts: 21
Joined: Fri Apr 11, 2014 8:57 pm

About Question enthuware.ocejws.v6.2.194 :

Post by evefuji » Sat May 24, 2014 3:59 pm

I not understand this explanation:
@HttpMethod(value="GET") is a valid annotation but it must be declared on a annotation

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

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

Post by fjwalraven » Sun May 25, 2014 1:40 am

Hi !

The @HttpMethod annotation is a meta annotation. An annotation that is used on other annotations (to create new annotations). The definition is:

Code: Select all

public @interface HttpMethod
Associates the name of a HTTP method with an annotation. A Java method annotated with a runtime annotation that is itself annotated with this annotation will be used to handle HTTP requests of the indicated HTTP method. It is an error for a method to be annotated with more than one annotation that is annotated with HttpMethod.
The @GET annotation is defined with the @HttpMethod as follows:

Code: Select all

public @interface GET
Note: from the explanation given by the @HttpMethod annotation you can conclude that it is not possible to annotate one method with @GET and @POST annotation at the same time.


Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest