This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Hi, struts is a layer for the presentation layer. ejb are used in business or integration layer. You should use J2EEPatterns (search on Sun site, there is a catalog) to communicate between presentation layer classes (struts) and business layer. (for example service locator and Business delegate). regards Axel
Joined: Jan 08, 2001
this text from Nadir Gulzars Pratical J2EE App book might make things clearer. (think this chapter was or is for free download on theserverside.com)
For distributed applications, an action class houses the control logic required for interacting with business logic in EJB components and will typically use a Business Delegate[Core] object for this purpose. Business delegate shields the request handlers from having to deal with the complexity of accessing distributed components. The business delegate design pattern promotes loose coupling between the request handlers and the server side components since the logic for accessing server side components is embedded in the business delegate. A request handler is written by a developer working in the presentation tier, while a business delegate is usually written by a developer responsible for creating the business tier services.
in big j2ee apps with ejb business logic is outside of struts.
For smaller non-distributed applications, the action class may contain business logic. When distributed processing in not required and business logic is embedded in request handlers, a Data Access Object [Core] can be used to abstract the underlying data access implementation; this provides a loose coupling between the request handlers and the data access layer, thus protecting the presentation tier from implementation changes in the integration tier. The base Action class of request handlers provides several convenience methods, please refer to the API documentation at http://jakarta.apache.org/struts/api/index.html.
in struts apps without struts business logic is (often) in struts action classes. [ June 07, 2003: Message edited by: Axel Janssen ]