Page 1 of 1

About Question enthuware.ocejws.v6.2.184 :

Posted: Wed Apr 23, 2014 2:58 pm
by mmookkiah
Don't we need annotation @Consumes("application/x-www-form-urlencoded") for request processor to choose right method in this question?

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

Posted: Wed Apr 23, 2014 3:15 pm
by fjwalraven
Hi !

It is not necessary to add an @Consumes annotation. When you don't provide one to your method it will use the default @Consumes("*/*") annotation (meaning: all media types are allowed).

Regards,
Frits

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

Posted: Wed Apr 23, 2014 4:16 pm
by mmookkiah
Html form submit sends HTTP request with header "Content-Type: application/x-www-form-urlencoded". In this case, the method which consumes "application/x-www-form-urlencoded" take higher precedence than method consumes "*/*".
Am I Correct?

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

Posted: Wed Apr 23, 2014 10:53 pm
by fjwalraven
Correct, that is how it normally works if there are multiple methods in the same root resource class.

However, in this question, the methods cannot be in the same resource file (they all have the same name and number of parameters).

Regards,
Frits