When to use Servlets verses JavaServer Pages?
Where to store client session state: client-tier, web-tier or EJB tier?
Access Data Base Resources via EJB or directly from JSP JavaBean ?
Do it primarily from the EJB tier. But use JaveBean when 1. Access to the data is read-only and non-transactional. 2. The application can tolerate stale data. 3. High performance is more important than consistant, reliable transaction.
When to use EJB components?
When to use Session Beans and when to use Entity Beans?
Entity Beans are usually used to model business concepts, the abstractions of real entities expressed as nouns. They are the object views of the business data; it also supports shared access from multiple users. So we use Entity Bean when we need 1. represent persistent data. 2. shared concurrent access to update data. 3. provide robust long-lived data management.