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

few basic question..

trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 613
Hi,

In struts framework, once the browser sends requests to JSP page, is it the controller servlet (action servlet) who populates the request parameters in form bean or the programmer has to take care of it.(I mean calling each getter and setter methods) ?
programmer is responsible for writting the validation logic and the execute method. am I right? Who sets the form bean fields??

thanks,
Trupti
Leandro Melo
Ranch Hand

Joined: Mar 27, 2004
Posts: 401
is it the controller servlet (action servlet) who populates the request parameters in form bean or the programmer has to take care of it.(I mean calling each getter and setter methods) ?

No, the programmer doesn't need to call getter or setter, the ActionForm is responsible for populating the bean.

programmer is responsible for writting the validation logic and the execute method

Naturally, validation is logic is part of business logic, so you'll need to write this logic. But keep in mind the Struts offers you a very nice automated way to do it, and you can even use the Validator framework.

The execute method (in the Actions) should be written by the programmer, they are business logic, right! However, there are other choices with LookupDispatchAction, ForwardAction, etc, that makes very neat things.


Leandro Melo
SCJP 1.4, SCWCD 1.4
 
wood burning stoves
 
subject: few basic question..
 
Similar Threads
Form Beans necessary?
Resources for New EJB programmer
Jsp to Servlet parameters
Global JNI Vs ENC
Portlet form data persistence