HI techies:
I am working on Weblogic 6.1 and have developed a Mailing Stateless Session Bean.
I have also done with some JavaBean to store the contents the user enters and appropriately process and send it to the EJB.I am facing a prb with the design now.Can anyone help me how to send the JavaBean to a EJB(Stateless Session Bean).
Help me with some example to do the same from the client side i.e. a jsp/application etc .
Looking to hear from you.
REgards
Ritesh
Email:riteshr at suvistas dot com
-
How to pass a JavaBean object to a EJB (4 messages)
- Posted by: Riteshr
- Posted on: February 12 2002 08:27 EST
Threaded Messages (4)
- How to pass a JavaBean object to a EJB by Kent Roylance on February 12 2002 17:01 EST
- How to pass a JavaBean object to a EJB by Gal Binyamini on February 12 2002 19:19 EST
-
How to pass a JavaBean object to a EJB by Riteshr on February 13 2002 05:14 EST
- How to pass a JavaBean object to a EJB by Gal Binyamini on February 13 2002 09:31 EST
-
How to pass a JavaBean object to a EJB by Riteshr on February 13 2002 05:14 EST
- How to pass a JavaBean object to a EJB by Gal Binyamini on February 12 2002 19:19 EST
-
How to pass a JavaBean object to a EJB[ Go to top ]
- Posted by: Kent Roylance
- Posted on: February 12 2002 17:01 EST
- in response to Riteshr
Just make sure your java bean implements the java.io.Serializable interface and you should be good to go. Every object that you use with EJB must implement the Serializable interface or have a parent object that implements the Serializable interface.
Good luck,
Kent -
How to pass a JavaBean object to a EJB[ Go to top ]
- Posted by: Gal Binyamini
- Posted on: February 12 2002 19:19 EST
- in response to Kent Roylance
Kent is right, and JavaBeans should generally be serializable anyway, according to the JavaBeans stanadard conventions.
I just wanted to note that not *all* objects you pass to an EJB must implement Serializable. Objects that are passed as fields of different objects do not have to implement Serializable - although they must be serializable at runtime. For more information see the Java Serialization spec. Also note the Remote objects can be passed to EJBs even if they are not serializable at all.
Gal -
How to pass a JavaBean object to a EJB[ Go to top ]
- Posted by: Riteshr
- Posted on: February 13 2002 05:14 EST
- in response to Gal Binyamini
Hi,
Thanks for the same.
I have developed the JavaBean using the java.io.Serializable interface.
Well,how should i pass the javabean object to the EJB.
It seems to me that the solution is to pass the JavaBean object to the Stateless session bean as a parm in your BUSINESS METHOD call.
theBean = context.create();
boolean result = theBean.sendMail(String smptHost,java.lang.Object);
The java.lang.Object is nothing but a type casted object of type JavaBean.
Would this work or can you suggest me a better alternative.
Regards
Ritesh
-
How to pass a JavaBean object to a EJB[ Go to top ]
- Posted by: Gal Binyamini
- Posted on: February 13 2002 09:31 EST
- in response to Riteshr
If the object is Serializable, you can just pass it to your bean like any other normal paramter... what could be better than that?
Gal