java - Rest Webservice in Controller or Service Layer? -


while developing rest based web service in jee 6 web application, containing jsf 2.0, cdi , ejb 3, make sense combine controller class (normally annotated @requestscoped) rest service definition @path?

or, should inside it's own *restservice class definition?

the project working follows below architecture requirement have rest services cater jsf clients, direct accesses other technologies.

jsf --> controller method (calls using rest client)--> rest service --> stateless business service --> dao (also stateless)

if combine controller , rest service (annotating methods @path), jsf client directly call controller method, , other client directly invoke rest service via url or rest client.

this permit take out rest client code invoking rest service controller.

thanks time in looking this.


Popular posts from this blog

javascript - Js, document.getElementById("ID").innerHTML, error -

objective c - Is there a way in OCMockito to make stubs fail when an unknown method is called? -

jquery - jqGrid update specific column data with out refreshing the entire column? -