Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Trying to pass an array to a bean.  RSS feed

 
Pascal Bisson
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I'm currently in trying to learn Java and I'm trying to find a way to pass by reference an array to a bean from a client. The code I have here doesn't seem to work and the only line that is giving me a problem is mySession.AChange(testArray); if I comment this line out the file runs great.


Side note. The method in the bean AChange is empty.
 
Piotr Nowicki
Ranch Hand
Posts: 611
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy Pascal!

Basically - how does your "arrayhelp" class look? What does the arrayhelp.ChangeArray(-) do and what error do you get?

And just a side note - I assume that you're using a remote interface to your EJB. If so, than you can only pass a value by copy. Array is an object, so you can't assume that the remote view of an EJB will change your array in any way. It can only do its job, change the array and return it to you.
If you were to use the local view of an EJB, the value would be passed by the reference, so the EJB could modify the object you're passing to it.

Cheers!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!