File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Need for EJB's in WebApplication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Need for EJB Watch "Need for EJB New topic

Need for EJB's in WebApplication

Ramesh Jothimani
Ranch Hand

Joined: May 05, 2011
Posts: 70

I am developing a real time website using Struts & Hibernate frameworks . I am a beginner to these frameworks & I am not aware of the usage of EJBs. Is it necessary to use EJBs in my webapplication ? Please suggest .

Thanks !
E Armitage

Joined: Mar 17, 2012
Posts: 989
Read this section of the EE tutorial.
It lists the scenarios where you might want to use EJBs.
Kevin Sheng

Joined: Jun 26, 2012
Posts: 13
Someone told me not use EJB for new projects, but I think it depends on the architecture/design of your application. I personally like using EJB in my application whenever possible, especially EJB 3 makes things easier and easier to code, but you do not have to.

It would be nice for someone to explain when to use EJB and when not to.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33113

1) Never use EJB 2.X on a new project. EJB 3.X has been out a long time now
2) Use something for transaction management - Spring and EJB are both viable choices, but I think it is best to use something unless you have a really small app.
3) If you are using Hibernate (vs JPA), Spring is going to be smoother than EJB.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Need for EJB's in WebApplication
It's not a secret anymore!