wood burning stoves 2.0*
The moose likes Struts and the fly likes Need a bit of clarification Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Need a bit of clarification" Watch "Need a bit of clarification" New topic
Author

Need a bit of clarification

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I need a little bit of understanding on a couple os STRUTS issues.
1. Why is the ActionForm not called an ActionBean.
2. Why is it that some poeple code another class for validation (e.g. to validate a user against the database) a Bean class when it has no Bean properties at all (no getter and setter methods).


GenRocket - Experts at Building Test Data
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944

1. Why is the ActionForm not called an ActionBean.

I think cause it represents an HTML Form. The Form class is used to transport the entered data in as an object to the Action classe

2. Why is it that some poeple code another class for validation (e.g. to validate a user against the database) a Bean class when it has no Bean properties at all (no getter and setter methods).

Cause this kind of validation shouldn't be bound to the MVC layer. If you replace struts with another framework you still can use your utility class for validation.
Is it that what you were asking for ?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I think cause it represents an HTML Form. The Form class is used to transport the entered data in as an object to the Action classe
I understand that. I just don't get why the STRUTS guys thought it was a good idea to call it an ActionForm instead of an ActionBean. When dealing with JSP/Servlets and not struts, these forms are called Beans. I just don't get why STRUTS has to call them something different. I mean, I understand how it works and what it does.
Cause this kind of validation shouldn't be bound to the MVC layer. If you replace struts with another framework you still can use your utility class for validation.
Again, I understand that. I know what it does. I just don't know why it is refered to as a Bean sometimes when it has no getter and setter methods.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need a bit of clarification