You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michael Obster <mi...@obster.org> on 2009/09/25 14:35:44 UTC

How to connect a EJB3 project with struts2

Hi,

I wanted to use Struts2 as frontend for an EJB3 application. After 
reading lots of documentation, I doesn't find out how I do that.
I only have found a description how to inject a EJB bean into a Spring 
bean, but then I need to implement the Spring bean class in the client a 
second time, what I don't want.

Formerly in older Struts1 applications I used a ServiceLocator to do a 
connect to the EJB3 beans, but I don't find any information if I can use 
this with Struts2.

Can you tell me what I should do to connect EJB3 and Spring/Strusts2 so 
I have access to the facade of my EJB3 layer in my struts2 action.

Kind regards,
Michael Obster

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


RE: How to connect a EJB3 project with struts2

Posted by James Cook <Ja...@wecomm.com>.
Hi Michael,

Looks like I no longer have the project that I did this in.

However from memory I can tell you:

I used jee:JNDI-Lookup
I had the EJB ref set up in the web.xml

With the id of the jndi-lookup item I used that as the ref for
injecting.. So with S2 it would be autowired...

If I get time, I may knock up a working example, as I want to refresh
myself with that aspect...

Cheers

James

-----Original Message-----
From: Michael Obster [mailto:michael@obster.org] 
Sent: 25 September 2009 15:07
To: Struts Users Mailing List
Subject: Re: How to connect a EJB3 project with struts2

Hi James,

ohh that would be good. I have tried some of the things they have 
documented on the side. But I didn't get it running. A practical example

would be very helpful to get the clou.

Kind regards,
Michael

James Cook schrieb:
> Hi Michael,
> 
> Look at the jndi-lookup in the spring manual.
> 
> http://static.springsource.org/spring/docs/2.5.6/reference/ejb.html
> 
> I have done this in the past, so will try to find some example code
> later - if required.
> 
> I did find I couldn't use SLSB tag as it required a home interface
that
> no longer exists in the spec. So that is why I opted for a
> jndi-lookup...
> 
> James
> 
> -----Original Message-----
> From: Michael Obster [mailto:michael@obster.org] 
> Sent: 25 September 2009 13:36
> To: user@struts.apache.org
> Subject: How to connect a EJB3 project with struts2
> 
> Hi,
> 
> I wanted to use Struts2 as frontend for an EJB3 application. After 
> reading lots of documentation, I doesn't find out how I do that.
> I only have found a description how to inject a EJB bean into a Spring

> bean, but then I need to implement the Spring bean class in the client
a
> 
> second time, what I don't want.
> 
> Formerly in older Struts1 applications I used a ServiceLocator to do a

> connect to the EJB3 beans, but I don't find any information if I can
use
> 
> this with Struts2.
> 
> Can you tell me what I should do to connect EJB3 and Spring/Strusts2
so 
> I have access to the facade of my EJB3 layer in my struts2 action.
> 
> Kind regards,
> Michael Obster
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ___________________________________________________________________
> This email has been scanned by MessageLabs on behalf of weComm Ltd.
> ___________________________________________________________________
> 
> ___________________________________________________________________
> This email has been scanned by MessageLabs on behalf of weComm Ltd.
> ___________________________________________________________________
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


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


___________________________________________________________________
This email has been scanned by MessageLabs on behalf of weComm Ltd.
___________________________________________________________________

___________________________________________________________________
This email has been scanned by MessageLabs on behalf of weComm Ltd.
___________________________________________________________________

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


Re: How to connect a EJB3 project with struts2

Posted by Michael Obster <mi...@obster.org>.
Hi James,

ohh that would be good. I have tried some of the things they have 
documented on the side. But I didn't get it running. A practical example 
would be very helpful to get the clou.

Kind regards,
Michael

James Cook schrieb:
> Hi Michael,
> 
> Look at the jndi-lookup in the spring manual.
> 
> http://static.springsource.org/spring/docs/2.5.6/reference/ejb.html
> 
> I have done this in the past, so will try to find some example code
> later - if required.
> 
> I did find I couldn't use SLSB tag as it required a home interface that
> no longer exists in the spec. So that is why I opted for a
> jndi-lookup...
> 
> James
> 
> -----Original Message-----
> From: Michael Obster [mailto:michael@obster.org] 
> Sent: 25 September 2009 13:36
> To: user@struts.apache.org
> Subject: How to connect a EJB3 project with struts2
> 
> Hi,
> 
> I wanted to use Struts2 as frontend for an EJB3 application. After 
> reading lots of documentation, I doesn't find out how I do that.
> I only have found a description how to inject a EJB bean into a Spring 
> bean, but then I need to implement the Spring bean class in the client a
> 
> second time, what I don't want.
> 
> Formerly in older Struts1 applications I used a ServiceLocator to do a 
> connect to the EJB3 beans, but I don't find any information if I can use
> 
> this with Struts2.
> 
> Can you tell me what I should do to connect EJB3 and Spring/Strusts2 so 
> I have access to the facade of my EJB3 layer in my struts2 action.
> 
> Kind regards,
> Michael Obster
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ___________________________________________________________________
> This email has been scanned by MessageLabs on behalf of weComm Ltd.
> ___________________________________________________________________
> 
> ___________________________________________________________________
> This email has been scanned by MessageLabs on behalf of weComm Ltd.
> ___________________________________________________________________
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


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


RE: How to connect a EJB3 project with struts2

Posted by James Cook <Ja...@wecomm.com>.
Hi Michael,

Look at the jndi-lookup in the spring manual.

http://static.springsource.org/spring/docs/2.5.6/reference/ejb.html

I have done this in the past, so will try to find some example code
later - if required.

I did find I couldn't use SLSB tag as it required a home interface that
no longer exists in the spec. So that is why I opted for a
jndi-lookup...

James

-----Original Message-----
From: Michael Obster [mailto:michael@obster.org] 
Sent: 25 September 2009 13:36
To: user@struts.apache.org
Subject: How to connect a EJB3 project with struts2

Hi,

I wanted to use Struts2 as frontend for an EJB3 application. After 
reading lots of documentation, I doesn't find out how I do that.
I only have found a description how to inject a EJB bean into a Spring 
bean, but then I need to implement the Spring bean class in the client a

second time, what I don't want.

Formerly in older Struts1 applications I used a ServiceLocator to do a 
connect to the EJB3 beans, but I don't find any information if I can use

this with Struts2.

Can you tell me what I should do to connect EJB3 and Spring/Strusts2 so 
I have access to the facade of my EJB3 layer in my struts2 action.

Kind regards,
Michael Obster

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


___________________________________________________________________
This email has been scanned by MessageLabs on behalf of weComm Ltd.
___________________________________________________________________

___________________________________________________________________
This email has been scanned by MessageLabs on behalf of weComm Ltd.
___________________________________________________________________

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