dcsimg
How to get an instance of an action form/ java bean in an EJB?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Vishal_T
Posted On:   Thursday, July 17, 2003 12:39 PM

Hi I'm new to EJBs so I'm not sure if this is the best solution for my problem. I wanted to be able to get an instance of my struts action form in my EJB so that after I make a stored procedure call I can store my values using the setter methods of the action form. Then I was thinking of creating a collection of them and passing my values back to the action class which called the EJB. The overall problem I'm trying to bypass is the inability to pass resultsets back to the client due to serialization issues. I was able to do this in my application using Struts/JSP, but I was wondering if this is possible when using EJB's. I did run by the notion of value objects ,but I didn't know if that is the best way to proceed.    More>>


Hi I'm new to EJBs so I'm not sure if this is the best solution for my problem. I wanted to be able to get an instance of my struts action form in my EJB so that after I make a stored procedure call I can store my values using the setter methods of the action form. Then I was thinking of creating a collection of them and passing my values back to the action class which called the EJB.


The overall problem I'm trying to bypass is the inability to pass resultsets back to the client due to serialization issues.


I was able to do this in my application using Struts/JSP, but I was wondering if this is possible when using EJB's. I did run by the notion of value objects ,but I didn't know if that is the best way to proceed.


I'm using WSAD 5.0

   <<Less

Re: How to get an instance of an action form/ java bean in an EJB?

Posted By:   Nick_Maiorano  
Posted On:   Saturday, July 19, 2003 10:05 AM

Vishal,



Value objects are probably the way to go because you don't want to expose the result set back to the struts/JSP layer. Not only would you have serialization issues, as you mentioned, but you would also have a dirtier architecture because you'd be exposing the inner workings of the persistence layer's result set.



If you have a big result set, you may consider using stateful session beans. The bean would conserve the result set in memory and allow the struts/JSP layer to make multiple calls to get a page of result set - one invocation at a time. Each page would be returned in value objects. If, on the other hand, you don't expect large result sets, simply return everything in one shot.

About | Sitemap | Contact