This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes EJB and other Java EE Technologies and the fly likes EJB web project in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB web project in Eclipse" Watch "EJB web project in Eclipse" New topic
Author

EJB web project in Eclipse

Jim Petersson
Ranch Hand

Joined: May 28, 2008
Posts: 48
Hi,
I've just started doing some EJB development, so far I've only used stand-alone java applications to test it and that works fine.
But now I thought I'd try do use a jsp/servlet web-app instead.

How do I set this up in Eclipse? Should I create a separate EJB project and a separate web-projects? (that depends on the EJB-proj)
Or is there some other project type that would incorporate both the EJB and web stuff?

Thanks,
Jim


SCJP 5<br />SCJD
Reza Rahman
author
Ranch Hand

Joined: Feb 01, 2005
Posts: 580
    
    5
Jim,

Try the Eclipse project wizard for an enterprise application (deployed as an EAR). It'll walk you through your choices.

Regards,
Reza


Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Jim Petersson
Ranch Hand

Joined: May 28, 2008
Posts: 48
Originally posted by Reza Rahman:
Jim,

Try the Eclipse project wizard for an enterprise application (deployed as an EAR). It'll walk you through your choices.

Regards,
Reza


Nice, exactly what I was looking for

Btw, thanks for the EJB3 in Action book, helped me alot!

Thanks,
Jim
Reza Rahman
author
Ranch Hand

Joined: Feb 01, 2005
Posts: 580
    
    5
Jim,

Glad to hear it and thanks for the kind words.

Regards,
Reza

P.S.: Please do consider writing a review for EJB 3 in Action on Amazon or elsewhere. We have some excellent reviews so far, but smaller in number than some other titles (not that quantity is everything).
Jim Petersson
Ranch Hand

Joined: May 28, 2008
Posts: 48
Ok, so now I've got a small app up and running. I have some EJB's (stateful and stateless), and a web-interface (jsp/servlet) communicating with my beans.
Now I would like to create some Entities using JPA, but I'm not sure how to set it up in Eclipse.
Should I create a new JPA-project? (and somehow connect that to my existing Enterprise project) Or should I just place my beans directly under my EJB-project?
Reza Rahman
author
Ranch Hand

Joined: Feb 01, 2005
Posts: 580
    
    5
Jim,

You can do it either way with the wizards. I prefer to just switch the JPA facet on for the EJB project and put the JPA classes there. There is also a very nice JPA perspective in Eclipse WTP that lets you do ORM mapping with a UI - very nice stuff...

Regards,
Reza
 
 
subject: EJB web project in Eclipse