• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB and Struts

 
James Foster
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My appln has these components:
1. UserForm - which is my ActionForm
2. UserAction
3. my EJB stuff
4. My DTO to tranfer data from web to ejb tier
Here is what happens:
The UserAction pulls the data out of UserForm, constructs a new DTO and sends it to the EJB stuff.
My question is, can I not send the UserForm directly to the EJB tier. I guess I should make it serializable. Are there any issues in this.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you really want to couple your EJB with your UI layer?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your UserForm is a Struts-derived UserForm it contains links to lots of things you don't want your EJB tier to know about, and that are not serializable. Thus, the common way of dealing with this is to copy information from the UserForm to a Value object (DTO) that is passed into the EJB as you note.
Kyle
[ December 12, 2003: Message edited by: Kyle Brown ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!