Struts ActionServlet's execute() method
I believe this method takes in the following parameters:
1) ActionMapping
2) ActionForm
3) HttpServletRequest
4) HttpServletResponse
Question 1:
The flow of the struts framework is that, if it finds a name="form" within theaction tag (which maps to the <form-bean name/type>) in the struts-config.xml, it will create or find the FORM BEAN. It uses this form bean/Action Form as the execute() parameter 2?
Question 2:
What if the form bean is not declare meaning that it does not have a form? Which or where can the parameter no.2 be found?
Question 3:
if action tag specifies VALIDATE="TRUE", it will invoke the form bean's validate() method before invoking the actionservlet's execute() method. What if the validate is set to "FALSE"?
Question 4:
Are all these controlled by the Web Container? Or it is the struts framework at play?
Thanks in advance.
# 1
hi buddy...
am too a learner..
First o all execute() method is not as part of ActionServlet but is part of Action class .
yes u r righrt the form bean object that is created will be placed in execute() of Action class.
if validate=true,implies that it will check for the validations in validations.xml file.
if validations=false =>After executing the vallidate() provided in our FormBean class it will not check for validations that are provided as part of Validations.xml file.
i think it is a must to have a form or else how can it be possible......
thank you ...if any mistakes plz let me know.
# 2
I have not come across anything call validation.xml.
All that I know is that if validate is specify to true in the ActionMapping inside struts-config.xml, the validate() method in ActionForm will be invoked.
RequestProcessor that ActionServlet delegates to will pass the user to the "input" attribute specified in the ActionMapping inside struts-config.xml. Since action() method actually returns an ActionErrors object whereby if it is empty then consider there are no erros and RequestProcessor will proceed with getting the Action and invoked its execute() method.....which will then return a ActionForward object.......
I hope what i mention is correct.