@HttpMethod(value="GET") is a valid annotation but it must be declared on a annotation
About Question enthuware.ocejws.v6.2.194 :
Moderators: Site Manager, fjwalraven
-
- Posts: 21
- Joined: Fri Apr 11, 2014 8:57 pm
- Contact:
About Question enthuware.ocejws.v6.2.194 :
I not understand this explanation:
-
- Posts: 429
- Joined: Tue Jul 24, 2012 2:43 am
- Contact:
Re: About Question enthuware.ocejws.v6.2.194 :
Hi !
The @HttpMethod annotation is a meta annotation. An annotation that is used on other annotations (to create new annotations). The definition is:
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.
Regards,
Frits
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
@Target(value=ANNOTATION_TYPE)
@Retention(value=RUNTIME)
@Documented
public @interface HttpMethod
The @GET annotation is defined with the @HttpMethod as follows: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.
Code: Select all
@Target(value=METHOD)
@Retention(value=RUNTIME)
@HttpMethod(value="GET")
public @interface GET
Regards,
Frits
Who is online
Users browsing this forum: No registered users and 7 guests