You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Martin Naskovski <mn...@san.rr.com> on 2003/08/01 01:01:02 UTC

Struts w/EJB

Hello all. Is there an app that demonstrates the use of Struts & EJB as a
persistence layer? I checked out Struts-Resume from Matt Raible, but it
uses Hibernate... Is there anything available w/EJB's? Thanks.

Martin
--


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Struts w/EJB

Posted by James Mitchell <jm...@apache.org>.
Download modelj from sourceforge and try it.  Supply the path to your
j2ee.jar and build the sample app in 2 minutes.  Modelj will create a
struts/ejb application for you from one single config file.  Using JBoss,
all you have to do is setup a default data source and deploy your
sample.ear.

http://sourceforge.net/projects/modelj


--
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org
678-910-8017
AIM:jmitchtx


----- Original Message ----- 
From: "Martin Naskovski" <mn...@san.rr.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Thursday, July 31, 2003 7:01 PM
Subject: Struts w/EJB


> Hello all. Is there an app that demonstrates the use of Struts & EJB as a
> persistence layer? I checked out Struts-Resume from Matt Raible, but it
> uses Hibernate... Is there anything available w/EJB's? Thanks.
>
> Martin
> --
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Struts w/EJB

Posted by Vic Cekvenich <vi...@baseBeans.com>.
Maybe EJB should be used with JSF (and blue prints 
http://java.sun.com/blueprints/code/index.html) instead of Struts.

Struts is more like this http://ibatis.com/jpetstore/jpetstore.html.
.V

Erik Price wrote:
> 
> 
> Martin Naskovski wrote:
> 
>> Hello all. Is there an app that demonstrates the use of Struts & EJB as a
>> persistence layer? I checked out Struts-Resume from Matt Raible, but it
>> uses Hibernate... Is there anything available w/EJB's? Thanks.
> 
> 
> 
> http://xpetstore.sf.net/
> 
> 
> There are two implementations of Xpetstore, one that uses EJB and one 
> that just uses servlets.  Check out the EJB one, it works great with JBoss.
> 
> Note, I personally don't think that using EJB is fundamentally different 
> from any other persistence layer, at least not in reference to Struts, 
> so you should be able to look at just about any sample code and figure 
> out some best practices.  It all boils down to the fact that you have 
> Struts Actions, which receive HTTP requests from the client, and which 
> then delegate the work to other objects.  Whether those objects are 
> session beans that perform some task by calling EJB or Hibernate 
> objects, or whether you're going the simple route (what I'm doing b/c my 
> needs are so trivial) and just having your Struts Actions directly 
> manipulate Data Access Objects which use JDBC business delegates, it's 
> not really much different.
> 
> The only big difference I've seen is that some people believe you should 
> abstract your model into a layer just beyond Struts Actions so that you 
> can switch from Struts to another framework if necessary.  But the other 
> line of reasoning is that this is a lot of extra work if you have no 
> plans to leave Struts.
> 
> My 2 cents.
> 
> 
> Erik

-- 
Vic Cekvenich,
Struts Instructor,
1-800-917-JAVA

Advanced <a href ="baseBeans.com">Struts Training</a>, mentoring and 
project recovery in North East.
Open Source <a href ="baseBeans.com">Portal Content Management</a> 
basicPortal  software.



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Struts w/EJB

Posted by Erik Price <ep...@ptc.com>.

Martin Naskovski wrote:
> Hello all. Is there an app that demonstrates the use of Struts & EJB as a
> persistence layer? I checked out Struts-Resume from Matt Raible, but it
> uses Hibernate... Is there anything available w/EJB's? Thanks.


http://xpetstore.sf.net/


There are two implementations of Xpetstore, one that uses EJB and one 
that just uses servlets.  Check out the EJB one, it works great with JBoss.

Note, I personally don't think that using EJB is fundamentally different 
from any other persistence layer, at least not in reference to Struts, 
so you should be able to look at just about any sample code and figure 
out some best practices.  It all boils down to the fact that you have 
Struts Actions, which receive HTTP requests from the client, and which 
then delegate the work to other objects.  Whether those objects are 
session beans that perform some task by calling EJB or Hibernate 
objects, or whether you're going the simple route (what I'm doing b/c my 
needs are so trivial) and just having your Struts Actions directly 
manipulate Data Access Objects which use JDBC business delegates, it's 
not really much different.

The only big difference I've seen is that some people believe you should 
abstract your model into a layer just beyond Struts Actions so that you 
can switch from Struts to another framework if necessary.  But the other 
line of reasoning is that this is a lot of extra work if you have no 
plans to leave Struts.

My 2 cents.


Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org