Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need a bit of clarification

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic