views:

52

answers:

3

Hi,

We can say Servlets are back end right? An interviewer once said "Servlets are not back end and for example Spring, EJB do". Is it right? Even spring MVC internally uses servlets to handle the requests right?

Thank You.

A: 

Yes and No. A servlet can be a back end to a http client request, but it may be a front end to an EJB, JDBC, or other remote call.

Rawheiser
In that point of view you are talking the databases systems are back-end of jdbc or enterprise java beans too... So it depends...
Alejandro
+2  A: 

"Servlets are not back end and for example Spring, EJB do"

the second part of that conjunction, "and for example,Spring, EJB do" doesn't make any sense.

Servlets run on the server, just like EJBs and Spring. They are at the 'top' of the back end. The typically invoke services that do things. From that point of view they are back end.

An example of client side code, i.e. something that is not back end, would be anything run in the browser, like javascript.

hvgotcodes
Basicallly we refer backend as database.
Suresh S
A: 

Some people treat backend as only your DAO and service layers and they generally treat servlets as part of your View in MVC. The current standard is to use Servlets only as a controller and there should not technically hold any business logic (in legacy applications there will be lot of business logic in servlets and jsp too). In that sense a servlet is truly not a backend but sometimes it can be treated as a backend too.

Teja Kantamneni