Struts And JavaServer Faces The Apache Software Foundation

Struts And Javaserver Faces The Apache Software Foundation-Free PDF

  • Date:13 Jan 2021
  • Views:1
  • Downloads:0
  • Pages:48
  • Size:304.62 KB

Share Pdf : Struts And Javaserver Faces The Apache Software Foundation

Download and Preview : Struts And Javaserver Faces The Apache Software Foundation


Report CopyRight/DMCA Form For : Struts And Javaserver Faces The Apache Software Foundation


Transcription:

Background,JavaServer Faces from a Struts Perspective. Extending JavaServer Faces Shale Framework,Graphical JavaServer Faces Java Studio Creator. Background The Origin of Struts, Like many open source projects Struts started with. me scratching my own itch,Take a U S centric application to Europe. Supporting multiple languages,And make it available on the web.
I was familiar with Java and Open Source,Apache JServ predecessor to Tomcat. Apache Tomcat,No good architectural models to follow. Background The Origin of Struts,Early versions of the JavaServer Pages JSP. specification became available,Version 0 91 described two basic approaches. Model 1 Resource is responsible for both creating a. page s markup and processing the subsequent submit. Model 2 Separate resources are responsible for, creating a page s markup and processing the submit.
The second approach sounded better, Separate resources for writing HTML and accessing DBs. So they can be built by different people,Perhaps using different tools. Background The Origin of Struts,I built a home grown architecture. Implemented a Model 2 design,Based on the model view controller MVC design. Contributed to Apache in June 2000,Release 1 0 occurred approximately one year later.
Model View Controller Terminology,Model Persistent data and the business logic that. processes that data, Often subdivided into persistence and business logic tiers. View The interface with which the user interacts, In webapps the HTML markup displayed in the browser. as well as state information about input field values. Controller Management software to perform a,request processing lifecycle on all requests. Uniform enforcement of login access restrictions,Consistent processing of all incoming requests.
In The Mean Time,A standardization effort JSR 127 was started. Harvest good ideas from existing implementations, Portable component API for interoperable components. For 1 0 focus mostly on components and provide,extension points for frameworks. Goals of the original JSR,Accessible to corporate developers. Accessible to tools,Client device neutral,Usable with or without JSP.
Usable with or without HTML,In The Mean Time,Let s look at the features of JavaServer Faces. From the perspective of someone already familiar,with the Apache Struts Framework. First Concept Components,In a rich client world AWT and Swing demonstrate. the value of a user interface component model,Components help you. Cleanly partition view tier requirements, Encapsulate complex behaviors in simple components.
Leverage parent child component relationships, Does not really have a user interface component model. Closest analog is JSP custom tags that render HTML. Additional responsibilities assigned to ActionForm and. Action classes provided by the application developer. First Concept Components,JavaServer Faces components. Render markup but are not limited to HTML,Process input field values. Including conversion and validation,Fire server side events. Save and restore view tier intermediate state,Net result no more form beans.
Components Are Arranged In A Tree,JavaServer Faces components are organized into a. hierarchical tree structure,View Root is singleton root component of the tree. Components can have arbitrary numbers of children,In addition components can have facets. Special purpose named children such as column headers. Components Are Arranged In A Tree,Components can take responsibility for processing. their children both input and output,h table id mytable var customer.
f facet name header,h outputText value Customer Name. h outputText value customer name,Components Are Arranged In A Tree. Or components can simply delegate to children,h form id logonForm. h panelGrid columns 2,h outputText value Username,h inputText id username. value logon username,h outputText value Password,h inputSecret id password.
value logon password,h commandButton value Logon,action logon authenticate. h panelGrid,Components Fire Server Side Events,Struts does not have an event processing model. Except for handling a form submit by calling execute. JSF uses standard JavaBeans event model, Event listeners can be registered on component instances. Components fire events when interesting things happen. Two standard patterns for event firing,ActionSource Component fires event stating that a. particular action component was activated by the user. Submit button hyperlink, EditableValueHolder Component fires event stating that.
the value of an input component was changed,Event model is extensible 14. Flexible Rendering Strategy,Struts rendering strategy has limitations. HTML tags render only HTML,HTML tags work only in JSP pages. In JSF responsibility for rendering is split from the. component creating a separate Renderer class,A set of Renderers is combined into a RenderKit. Supports reuse of components in different environments. Struts And JavaServer Faces Craig R McClanahan Senior Staff Engineer Sun Microsystems 2 Agenda Background JavaServer Faces from a Struts Perspective Extending JavaServer Faces Shale Framework Graphical JavaServer Faces Java Studio Creator Summary 3 Background The Origin of Struts Like many open source projects Struts started with me scratching my own

Related Books