- Page Author can independently design a web page with easy to use tools backed by extensive tag library.
- Application developers integrates UI design with event, valiation, convertor and objects.
- Component Writer can write new components in extensible and customizable nature.
- Architect can independently define navigation, ensure scalability of applicability and configure bean obj registration.
- Tool Vendors can independently develop tools to make design of web a easy experience with intuitive drag-n-drop features
JSP/Servlet: Lack of
- UI component
- UI component model
- Event model
- State Management
- Support for multiple render
- Standard
- JSF - View / Separate controller
- Servlet - View/Controller combined
- Struts - Controller
Building Blocks
- Component
- Event listener
- Validator
- Back-end data integration
- JSF Tag and API
- JSP 1.2
- Servlet 2.3

1. Restore View Phase
- FacesContext - Build view of JSF/wires event handlers and validator.
- New Req - Create empty view
- Middle Req - Restores the view state from client/server
- decode Method -
- Extracts values from Req parameters for all UI Component
- Type conversion to all component
- Validates all extracted values to all components
- Error - Queue it on FacesContext and advance the lifecycle to Render Response Phase.
- Updates/Assign server-side object with corresponding component's local value
- Type conversion from component to model properties
- Invokes any application-level events
- Invoke ActionListener Impl (success action)
- Pass outcome to NavigationHandler (default)
- Navigation Rule (config file) - Match outcome to response view
- JSF - Set response view to page
- encode Method:
- Renders components from component tree of FacesContext
- Create appropriate markup for component tree
- Save the state of response
- UI Component Model
- Rendering Model, Event and listerner model, conversion model and validation model .
- Configuration File:
- faces-config.xml
- Types of Event:
- ActionEvent
- ValueChangeEvent
- PhaseEvent
- Types of localization
- Static data
- Dynamic data
- Messages
- Steps for Static localization
- Create ResourceBundle
- Ref bundle from pages
- Ref the localized messages within bundle
- Important Top Classes
- For view: Parent is UIView
- For component: UIComponent
- Standard Component:
- UIForm - represents a user input form that is a container of other components.
- UICommand - represents UI components like buttons, hyperlinks and menu items.
- UIInput - represents UI components like text input fields, numeric input fields.
- Custom Component:
- User/Developer designed component on top of standard components as well as other custom component.
- Great feature of JSP is power to use third party components seamlessly. How to create custom component?
- Either implement UIComponent interface or extend UIComponentBase class to bring default behavoiur of component
- JSF Core
- <%@ taglib uri=”http://java.sun.com/jsf/core “ prefix=”f” %>
- JSF Html
- <%@ taglib uri=”http://java.sun.com/jsf/html “ prefix=”h” %>
0 comments:
Post a Comment