• Post Reply Bookmark Topic Watch Topic
  • New Topic

when to use servlets and when to use EJB

 
srivijaya
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when to use servlets and when to use EJB...I have a big confusion.I can get all the features what ever there in EJB are also there in Servlets or JSp then why should i go to EJB.Except for transactions.
Regards
Vijaya
 
krish
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the J2EE specification clear description had given when to use Servlets,JSP and EJB.
This approach is called MVC(Model View Controller)
we should devide our application to MVC design,such as chop the entire application to presentaion layer ,web layer ,business layer and data layer.
Choose HTML/JSp presentaion layer,Servlets for web layer or tier,EJB for Business Layer(Session beans for action components(tipically performs business operations),entity beans to data components(tipically for database access pupose).By using this kind of apprach we can achive better coordination among layers and quick results
-krish
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"krish",
Thanks for joining JavaRanch, but could you just take a quick look at the naming policy and edit your profile.
Also, only members with valid names will be eligible for the book giveaways.
Thanks
Simon
Bartender (moderator) of "J2EE and EJB" forum
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!