I have seen models of multi tiered Applications which use both servlets and EJBs. The way I see it, JSP represents the view, and servlets used to represent the business logic and link to the resources. With EJBs managing the business logic and EJB containers managing the resources, do we need the servlets. Cheers for any help. Tony
many systems use JSP-Servlet_Appserver combination so it is quite obvious to get confused For a even more modular system, we can have a JSP-Servlet-EJB-AppServer architecture. Servlets act as pure extensions of the web server.. handle the requests, delegates calls to EJBs , "locating" them and then proceeding. EJBs contain all the pure business logic. Does it help ? Thanks for your cheers ! Leena
I guess then you have to take a more finely defined understanding of business logic - Servlets are more performant than EJBs as well as lighter weight. Your servlets could include the application logic, while the EJBs would then become pure business logic, so, for a poor example perhaps: JSPs show you balance Servlets allow you to apply for an overdraft EJB decides whether you can have one JSP shows the result of the request. I am not sure how sound an idea it is to be using EJBs from inside a JSP...
chanoch<p><a href="http://www.amazon.com/exec/obidos/ASIN/1861007736/" target="_blank" rel="nofollow">Author of Professional Apache Tomcat</a></p>
For a more detailed explanation of typical web application architectures, check out this chapter from Professional Java Servlets 2.3 to see where Servlets, JSPs and EJBs fit into the picture. Hope that helps Simon
Joined: Jun 29, 2002
Thank you for the helpful replies, I will read up on that chapter. Cheers Tony