users@glassfish.java.net

Re: Sample

From: <glassfish_at_javadesktop.org>
Date: Wed, 21 Nov 2007 12:01:34 PST

Sample of what? "uses EJB" is kind of vague.

If you want, you can download Netbeans and "make your own" sample.

Seriously, the hardest part is coming up with a SessionBean name, the IDE does pretty much all the rest.

Create an Enterprise project with a WAR, then in the -ejb module you use the menu to create new Session Bean, or an Entity from the database.

Once you have your session bean, go to your -war, create a new servlet.

In the servlet, in the service method that the wizard exposes, you can then right click, Enterprise Resource -> Call Enterprise Bean (I think), and it will show you your session bean, and add it as an injected resource in to your servlet. Then you can simply use it like any other object.

So, it really depends on what you want to do.
[Message sent by forum member 'whartung' (whartung)]

http://forums.java.net/jive/thread.jspa?messageID=246648