02-Struts-Actions.pdf - © 2010 Marty Hall Jakarta Struts...

This preview shows page 1 - 4 out of 21 pages.

© 2010 Marty Hall Jakarta Struts: Processing Requests with Action Objects Struts 1. x Version Customized Java EE Training: Servlets, JSP, JSF 2.0, Struts, Ajax, GWT 2.0, Spring, Hibernate, SOAP & RESTful Web Services, Java 6. Developed and taught by well-known author and developer. At public venues or onsite at your location. © 2010 Marty Hall For live Struts training, please see training courses at coreservlets com/ courses at . Taught by the author of Core Servlets and JSP , More Servlets and JSP and this tutorial Available at C d l d d t ht b M t H ll , and this tutorial. Available at public venues, or customized versions can be held on-site at your organization. Courses developed and taught by Marty Hall Java 6, servlets/JSP (intermediate and advanced), Struts, JSF 1. x , JSF 2.0, Ajax, GWT 2.0 (with GXT), custom mix of topics Ajax courses can concentrate on 1 library (jQuery, Prototype/Scriptaculous, Ext-JS, Dojo, Google Closure) or survey several Courses developed and taught by coreservlets.com experts (edited by Marty) Spring, Hibernate/JPA, EJB3, SOAP-based and RESTful Web Services, Ruby/Rails Contact [email protected] for details
Image of page 1

Subscribe to view the full document.

Agenda Struts flow of control The six basic steps in using Struts To implement the flow of control E l lt i Example: one result mapping Same output page in all cases Example: multiple result mappings Different output pages depending on the input 5 Struts Flow of Control JSP struts-config.xml Form Determine Action Action Choose JSP Page submit form request .../ blah .do invoke execute method return condition forward to JSP 6
Image of page 2
Struts Flow of Control The user requests a form For now we use normal HTML to build the form For now, we use normal HTML to build the form Later we will use the Struts html:form tag The form is submitted to a URL of the form blah .do. That address is mapped by struts-config xml to an Action class That address is mapped by struts-config.xml to an Action class The execute method of the Action object is invoked One of the arguments to execute is a form bean that is automatically created and whose properties are automatically populated with the incoming form data The Action object then invokes business logic and data-access logic, placing the results in normal beans stored in request, session, or application scope. The Action uses mapping.findForward to return a condition, and the conditions are mapped by struts-config.xml to various JSP pages. Struts forwards request to the appropriate JSP page The page can use bean:write or the JSP 2.0 EL to output bean properties The page can use bean:message to output fixed strings 7 The Six Basic Steps in Using Struts 1. Modify struts-config.xml.
Image of page 3

Subscribe to view the full document.

Image of page 4
  • Fall '19
  • Subroutine, JavaServer Pages, Mr. Bean, Marty Hall

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes