This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts" Watch "struts" New topic


charishma gottumukkula

Joined: Nov 06, 2006
Posts: 20
Difference between actionform in struts and value objects
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
A Value object or data transfer object (DTO) is a Plain Old Java Object (POJO) that is used to transfer information between the model layer and the view layer. An ActionForm belongs strictly to the view layer, and acts as a Java representation of an individual JSP page.

One might think "Hey, these two objects look similar. Why not just use the ActionForm as a DTO?"

This is not a good idea. Using an ActionForm as a DTO introduces a dependency on Struts into your Model layer. Model objects should maintain independence from any type of view logic or view platform.

Consultant, Sima Solutions
It is sorta covered in the JavaRanch Style Guide.
subject: struts
Similar Threads
InnerHTML and struts tags
URL rewrite to maintain session state
Eclipse IDE - How to set up a Struts 2 project
Action class in Struts
Struts interview questions