On Github pmpfl / revealjs
Created by ImpactZero Software
Part of the Profile suite of products built specifically as a servicing platform to provide unique perspectives into Profile Data.
WebClient: Consumer Internet Banking Perspective
WebCSR: Call Center and Branch Perspective
WebTeller: Bank Teller Perspective
WebAdmin: Profile and third-party System Configuration Perspective
WebCSR: Call Center and Branch Perspective
J2EE Standards-based and Open Source Architecture:
Designed for a Single Profile Host, not targeted as an Integration Hub;
Created by ImpactZero Software
An MVC Framework?
Struts provides a unified framework for deploying servlet and JSP applications that use the MVC architecture.
A Collection of Utilities?
Struts provides utility classes to handle many of the most common tasks in Web application development.
A Set of JSP Custom Tag Libraries?
Struts provides custom tag libraries for outputting bean properties, generating HTML forms, iterating over various types of data structures and conditionally various types of data structures, and conditionally outputting HTML.
Centralized file-based configuration
Form Beans
In JSP, you can use property="*" with jsp:setProperty to automatically populate a JavaBean component based on incoming request parameters. Apache Struts extends this capability to Java request parameters. Apache Struts extends this capability to Java code and adds in several useful utilities, all of which serve to greatly simplify the processing of request parameters.
Form field validation
Create a Hello World Project, with the following structure
Created by ImpactZero Software
The user requests a form
The form is submitted to a URL of the form
The execute method of the Action object is invoked
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
Edit project from Day 1
Create a form for authentication with :
Password
If password length is less than six characters
Display a error screen
If password length is greater than six characters
Display a success screenCreated by ImpactZero Software
The user requests a form
This form is built with html:form, html:text, and similar elementsThe form is submitted to a URL of the form blah.do
The execute method of the Action object is invoked
Struts forwards request to the appropriate JSP page
The page can use bean:write or the JSP 2.0 EL to output bean propertiesUsing html:form to declare form in initial JSP page
The action should exactly match path attribute of action element in struts-config.xmlUsing the Struts html:form elements
The action should exactly match path attribute of action element in struts-config.xmlUsing html:text and similar elements to declare the input fields of the form.
Using html:text and similar elements to declare the input fields of the form.
<html:text property="firstName"> </html:text>
Edit Day 2 project
Please use html: elements
If user authenticate with success
Display the user name and password in a new jspCreated by ImpactZero Software
Centralized updates
If a message is used in several places, it can be updated with a single change. This is consistent with the Struts philosophy of making as many changes as possible in config files, not in Java or JSP codeI18N
If you use messages pervasively in your JSP pages, you can internationalize your application by having multiple properties files corresponding to the locale, as with standard I18N in Java MessageResources.properties MessageResources.properties MessageResources.propertiesDefault properties file
When you say<message-resources parameter="someName" ...=""> </message-resources>WEB-INF/classes/someName.properties is loaded and treated as the default file
More specific properties file
The system automatically looks for additional, specialized files corresponding to your LocaleProperties File
error.missing=You must enter {0}, you idiot!
Edit Day 3 project
Create a message resources properties
Create a parameterized message.
If the user logins wiht success the following should appear: Welcome {0}Created by ImpactZero Software
The user requests a form
The form has radio button, push button, or hidden field with a special name, and whose values correspond to method namesThe form is submitted to a URL of the form blah.do.
The method is selected based on the special form parameter.
Struts forwards request to the appropriate JSP page.
The form has a special parameter
The parameter is declared in struts-config.xml
The form bean needs no setter method for the special parameter
Extend DispatchAction instead of Action
Edit Day 4 project
Create a "Sign Up" button on the login page.
Both buttons should use the LoginActionCreate a Sign Up Form
Data required:Created by ImpactZero Software
Give page for specific type of exceptio
Use exception entry in global-exceptions or actionGive page for generic Exception
Use exception entry in global-exceptions, or Use exception-type entry in web.xml, or use error-page attribute of page directiveGive custom handler for specific type of exception
Use exception entry in global-exceptions or action, and Define subclass of ExceptionHandlerEdit Day 5 project
Create a error page - 404 Error
Create an exception - "ImpactZeroException"
Create a new page for this exception It will be triggered if the user name length is greater than 12Create custom exception handler
Create a message based on the errorCreated by ImpactZero Software
Performing validation in the ActionForm
Create an ActionForm method called validate
Create a property file with error messages
Use in input form
No validation logic needed in Action
Error messages reflect runtime valuese
Less repetition of error messages
More meaningful error messages for situations other than missing-data
No validation logic needed in Action
Edit Day 6 project
Validate Login and Signup page - Using Parameterized Error Messages
Created by ImpactZero Software
Consolidates validation code
Lets you use standard validation rules
Runs on server; can optionally also run on client
Described by XML files
Configure struts-config.xml
Edit the properties file
Put validation rules in validation.xml
Have form bean extend ValidatorForm
Use html:errors as before
Edit Day 7 project
Create a combined validation (Manual and automatic) for Login and Signup pages
Created by ImpactZero Software
Avoiding repetition
Centralized changes
Usage of config files
Sketch out desired layout
Do this on paperMake template file that represents layout
Create JSP pages that define layout pieces
Define layouts in WEB-INF/tiles-defs.xml
Create JSP pages that use layouts
Edit Day 8 project
Convert the project to use Tiles
Create a base.jsp with the following entries:
title
header
content
footer
Created by ImpactZero Software
Using the JSP Standard Tag Library
Accessed via ${expression}
Similar to JavaScript and XPath
Provides shorthand notation to access:
Attributes of standard servlet objects Bean properties Map, List, and Array elementsfmt:formatNumber
Formats a numeric value as a number, currency value, or percent, in a locale-specific mannerfmt:parseNumber
Reads string representations of number, currency value, or percentfmt:formatDate
fmt:parseDate
fmt:timeZone
fmt:setTimeZone
Edit Day 9 project
Display a list on the success login page with:
Restaurant Name
Price
Date added
Use Format tags
Created by ImpactZero Software
Spring is a framework with many modules
Core module: dependency injection
Lets you define an XML file that specifies which beans are created and what their properties areSecond most important module: AOP
“Aspect Oriented Programming” refers to the ability to add side effects to a class’ method calls without modifying the class’ source code Lets you separate business logic from system servicesSpring is useful when :
You have objects whose implementations change often These objects are defined in bean definition file, isolating Java code from changes in the implementation You supply initialization values via constructors or settersSpring is even more useful when
The initialization values are other beans. That is, your Spring-managed objects depend on other bean values. Supplying these values in bean definition file is called Supplying these values in bean definition file is called “dependency injection” Because Java code doesn’t have to depend explicitly on specific concrete values specific concrete values Instead, bean values are passed in (“injected”) at run time Also called “Inversion of Control” (IoC)Design depending types to receive implementations
Allow dependencies to be supplied using property setters or constructorsAvoid constructing objects from the client to fulfill dependencies
For example, do not use the new operator to manage servicesEdit Day 10 project
Create a class called: UserManager. With the following methods :
Inject that class into LoginAction and SignUpAction.
Created by ImpactZero Software
A flow encapsulates a reusable sequence of steps that can execute in different contexts.
A flow consists of a series of steps called "states"
Entering a state typically results in a view being displayed to the user
On that view, user events occur that are handled by the state
These events can trigger transitions to other states which result in view navigations.
<!--?xml version="1.0" encoding="UTF-8"?--> <flow xmlns="http://www.springframework.org/schema/webflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/springwebflow-2.0.xsd"> </flow>
<view-state id="enterBookingDetails"> </view-state>
transition
Use the transition element to handle events that occur within a state.<view-state id="enterBookingDetails"> <transition on="submit" to="reviewBooking"> </transition></view-state>
end-state
Use the end-state element to define a flow outcome.<end-state id="bookingCancelled"> </end-state>
<flow xmlns="http://www.springframework.org/schema/webflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/springwebflow-2.0.xsd"> <view-state id="enterBookingDetails"> <transition on="submit" to="reviewBooking"> </transition></view-state> <view-state id="reviewBooking"> <transition on="confirm" to="bookingConfirmed"> <transition on="revise" to="enterBookingDetails"> <transition on="cancel" to="bookingCancelled"> </transition></transition></transition></view-state> <end-state id="bookingConfirmed"> <end-state id="bookingCancelled"> </end-state></end-state></flow>
Edit Spring project
Create a new flow