Dashboard > Struts University > Home > MailReader Training Course > Topics > Logout-Notes
Logout-Notes
Added by Ted Husted, last edited by Ted Husted on Jul 13, 2007  (view change)
Labels: 
(None)


The action mappings work closely with the result types to guide clients through the application.

Presentation - Mapping workflows

How can we authenticate clients? When things go wrong, how can we display error messages? How can we vary how results are handled?

Let's look at how we can make sure that the right people find out the right things at the right time in the right way.

  • Authenticating Clients
  • Error Handling
  • Result Types

Workshop - Logout, Login

Story: Subscribers can end an application session, retaining any changes. Subscribers can present their registration credentials to use an account again.

  • Implement application-based authentification
  • Implement navigation for Cancel buttons
  • Add field-based errors
  • Adjust application flow based on circumstances

Prerequisites

  • Application-based authentification
  • SessionAware
  • addFieldError
  • hasErrors
  • Cancel actions
  • redirect-action result type
    • onclick="form.onsubmit=null"

Exercises

  • Import the MailReaderSupport class from the "logout" source.
  • Review the Logout and Login use cases
  • Update the Register action to save the user object after it is created (See updated MailReaderSupport class.)
  • Create Logout action to set User object to null.
  • Create Login action to find User and set the User property (if it is found and there are no errors).
  • Create validation for Login that requires Username and Password.
  • Add Cancel buttons to Login and Register that return to Welcome.
  • Update Menu.jsp to refer to user.fullName.
  • On Register SUCCESS, use a "redirect-action" result to goto Menu.

Accomplishments

  • Implemented application-based authentification
  • Implemented navigation for Cancel buttons
  • Added field-based errors
  • Adjust application flow based on circumstances

Extra Credit

  • Unit test the new classes
  • Use Selenium to test the new workflow

Site running on a free Atlassian Confluence Open Source Project License granted to OSS. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.5 Build:#811 Jul 25, 2007) - Bug/feature request - Contact Administrators