Java: Struts: Lesson 5: Processing Requests with Action Objects #Java Short Notes

Corresponding Video Tutorial
Code Example for this article

  • What happens? When a form is submitted?
  • Flow:
    1. Refer to a x.do from form action
    2. Check struts-config.xml for action named 'x'
    3. 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)
    4. The method will usually return a string using mapping.findForward("string"),
    5. Then the string will be matched in struts-config.xml file in the global forwards section or as part of the actions.
    6. In forwards a string is mapped to a destination web-page/action
  • Steps to write a simple application [one programmer]:
    1. Create the first web-page with the form [html/jsp]
    2. 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]
    3. 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,
    4. Write the class and the corresponding execute method
    5. 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.
    6. 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

Permanent link to this article: http://bangla.sitestree.com/java-struts-lesson-5-processing-requests-with-action-objects-java-short-notes/

Leave a Reply