calling EJB's from struts applications

Hello Techies,How can i call EJB's from struts application.Can we implement Transaactions in stateless session Beans.regards,ramu
[165 byte] By [ksrka] at [2007-10-2 6:15:46]
# 1

>How can i call EJB's from struts application.

The same way as you would call an EJB from a simple web application. Read some tutorial to find out how EJBs are called from client applications.

> Can we implement Transaactions in stateless

> ess session Beans.

Yes.

annie79a at 2007-7-16 13:17:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Thanks for u r reply.Since stateless session bean does not hold the conversational state then How can we implement transactions in stateless session bean.can u give me sample code.regards,ramu.
ksrka at 2007-7-16 13:17:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

> Since stateless session bean does not hold the

> the conversational state then How can we implement

> transactions in stateless session bean.

Since stateless session beans do not hold the conversational state, the only restriction is that your transaction cannot span across methods... a method that begins a transaction must commit or rollback to end the transaction.

>can u give me sample code.

Google for that.

annie79a at 2007-7-16 13:17:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4

One has to first decide to go in for Stateful or Stateless Session bean depending on the requirement to hold converstational state in order to implement transactions in an EJB.

Once you decide this then code accordingly. Most of the samples are available in the examples section of Weblogic installer just in case if you have downloaded/installed Weblogic App Server.

Rgds,

seetesh

seteshhindlea at 2007-7-16 13:17:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5
>>call EJB's from struts applicationFrom the Action (java) file, creqte a Business Delegate/Command pattern based class which will call the appropriate business method of the EJB having the right transaction attribute set in its deployment descriptor file.
seteshhindlea at 2007-7-16 13:17:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...