This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
A servlet is an interface that lets you work in a client-server model. The client submits a request to the server and the server uses a Servlet implementation to handle the client request and send a response. The servlet definition is in Java EE.
An ejb is a pattern, there are many kinds of ejb, but I think in essence they are a business logic encapsulation unit. They are also part of the Java EE.
In the simplest scenario a client wants something from a server, then sends a request lets say via a browser, then the server uses a specific servlet to handle the request. The servlet understands what the client wants and calls an ejb who is the one that knows the business logic. The EJB returns the results, the servlet interprets the results and sends the response to the client.
Both of them can be applied in many kinds of scenario, some ejb only talk with other ejb, some let you send messages to applications, etc.
She will remember your heart when men are fairy tales in books written by rabbits.<br /> As long as there is duct tape... there is also hope.
Please ask these questions in the servlet and ejb forums. For such questions you can always "GOOGLE".
"A servlet is a Java programming language class used to extend the capabilities of servers that host applications accessed via a request-response programming model" Reference URL
"Enterprise Java Beans is a component architecture for the development and deployment of object-oriented, distributed, enterprise-level applications. Applications written using the Enterprise JavaBeans architecture are scalable, transactional, multi-user and secure." Reference URL
if you can't understand the above definitions please feel free to ask !! have a nice day