• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

With EJB why use Servlets.

 
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 351
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Tony Evans
Ranch Hand
Posts: 681
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the helpful replies, I will read up on that chapter.
Cheers Tony
 
reply
    Bookmark Topic Watch Topic
  • New Topic