aspose file tools
The moose likes EJB and other Java EE Technologies and the fly likes Return value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Return value" Watch "Return value" New topic

Return value

Tmmet Johnson
Ranch Hand

Joined: Nov 03, 2004
Posts: 56
I am new to EJB.Can anyone say me whether I can return ArrayList from my bean method ?
That is, all my input and output parameters of my bean method must always be serializable objects ?

Thanks in advance,
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

Yes, you can because ArrayList is Serializable.

SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
I think you may to be sure that the objects in the ArrayList are also Serializable.

SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Amit M Tank
Ranch Hand

Joined: Mar 28, 2004
Posts: 257
Not necessarily if you are using Local EJBs. Remote EJBs are extension of RMI and if your objects which are not serializable or Remote in nature then there can be issues at runtime.

Amit Tank
Linked In
It is sorta covered in the JavaRanch Style Guide.
subject: Return value