Corresponding Video Tutorial
Code Example for this article
- What happens? When a form is submitted?
- Flow:
- Refer to a x.do from form action
- Check struts-config.xml for action named ‘x’
- Check the corresponding type (class) of the action, execute the execute method of that action type (really a class where execute is the class method)
- The method will usually return a string using mapping.findForward(“string”),
- Then the string will be matched in struts-config.xml file in the global forwards section or as part of the actions.
- In forwards a string is mapped to a destination web-page/action
- Steps to write a simple application [one programmer]:
- Create the first web-page with the form [html/jsp]
- Create an action for the action string of this form in struts-config.xml file [mention the type/class, and corresponding forwards and specify the destination]
- The destination of a forward can be another action, forwards can be part of the action or can be placed in the global forwards section,
- Write the class and the corresponding execute method
- In the execute method you may require to collect the user supplied values/inputs, process the data and return a string using mapping.findForward based() on your logic/requirements.
- Create the destination pages.
From: http://sitestree.com/?p=4972
Categories:Java Short Notes
Tags:
Post Data:2013-03-27 11:44:23
Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada