Download presentation
Presentation is loading. Please wait.
Published byShannon Wheeler Modified over 9 years ago
1
Java Web Application Framework (WAF) Melek OKTAY 50050403 moktay@fatih.edu.tr
2
Outline □Introduction □Java Web Aplication Framework □Conclusion
3
Outline □ Introduction □What is Framework □What is WAF □Java Web Aplication Framework □Conclusion
4
What is Framework? □Introduction □ What is Framework □What is WAF □Java Web Aplication Framework □Conclusion
5
What is Framework? □In information systems environment, a framework is a defined support structure in which other software applications can be organized and developed. □A software framework is a reusable design and building blocks for a software system and/or subsystem
6
What is Framework? (cont.) □In an object-oriented environment, a framework consists of abstract and concrete classes. Instantiation of such a framework consists of composing and subclassing the existing classes □Software frameworks rely on the Hollywood Principle: "Don’t call us, we’ll call you."
7
What is Framework? (cont.)
8
Why we use Framework? □The software frameworks significantly reduce the amount of time, effort, and resources required to develop and maintain applications.
9
What is Framework? □Introduction □What is Framework □ What is WAF □Java Web Aplication Framework □Conclusion
10
What is WAF? □A Web Application Framework (WAF) is a reusable, skeletal, semi-complete modular platform that can be specialized to produce custom web applications, which commonly serve the web browsers via the Http's protocol. □WAF usually implements the Model-View-Controller (MVC) design pattern, typically in the Model 2 architecture to develop request-response web- based applications on the Java EE and.Net models.
11
What is WAF? (cont.) □Model 1 Architecture
12
What is WAF? (cont.) □Model 2 Architecture
13
Model-View-Controller
14
Why we use WAF? □Virtually all web applications have a common set of basic requirements, such as user management e.g., secure user login, password recovery ), group management, and access authorization. □A Web Application Framework usually includes all these functionalities, refined through hundreds of production deployments, freeing developers to focus on the needs of their specific application.
15
Why we use WAF? □WAFs store important data in a relational database and they interact with users via a web-based user interface. □Any application written on top of a Web Application Framework can transparently and immediately take advantage of these basic services.
16
□Introduction □Java Web Aplication Framework □Conclusion
17
Java Web Aplication Framework □Introduction □ Java Web Aplication Framework □Request-based Framework □Component-based Framework □Hybrid – Meta Framework □RIA-based Framework □Conclusion
18
Request-based Framework □Introduction □Java Web Aplication Framework □ Request-based Framework □Component-based Framework □Hybrid – Meta Framework □RIA-based Framework □Conclusion
19
Request-based Framework □A Request-based Framework is very close to the original CGI specification. □It uses controllers and actions that directly handle incoming requests. □Each request is essentially stateless.
20
Request-based Framework □Introduction □Java Web Aplication Framework □Request-based Framework □Struts □WebWork □Beehive, Stripes □Component-based Framework □Hybrid – Meta Framework □RIA-based Framework □Conclusion
21
Request-based Framework □Introduction □Java Web Aplication Framework □Request-based Framework □ Struts □WebWork □Beehive, Stripes □Component-based Framework □Hybrid – Meta Framework □RIA-based Framework □Conclusion
22
Struts □Struts was originally developed by Craig McClanahan and donated to the Apache Foundation in May 2000. □Struts has been a de facto framework with a strong and vibrant user community.
23
Struts (cont.) □Struts uses and extends the Java Servlet API to adopt the "Model 2" approach, a variation of the classic Model-View-Controller (MVC) design pattern.
24
Struts (cont.) MVC Design pattern
25
Struts Tag Libraries □HTML Tags □Bean Tags □Logic Tags □Template Tags □Custom Tags
26
Struts HTML Tags □The tags in the Struts HTML library form a bridge between a JSP view and the other components of a Web application. □Since a dynamic Web application often depends on gathering data from a user, input forms play an important role in the Struts framework
27
Struts HTML Tags □ HTML "form" tags □button □cancel □checkboxes □file □hidden □image □multibox □password input fields □radio buttons □reset buttons □ HTML "form" tags □select lists with embedded □option □options □submit buttons □text input fields □textareas
28
Project Refinery, Inc. 28 HTML Tags – Typical HTML Form □ □ First Name □ □ Street Address □ □ City □ □ State □ □ Postal Code □
29
Project Refinery, Inc. 29 HTML Tags – Typical Struts Form □
30
Project Refinery, Inc. 30 Application Set-up Jar files Tag libraries Struts-config dtd Application.properties Apache vhost file Web.xml Struts-config.xml
31
Project Refinery, Inc. 31 Some Struts Sites: Travel
32
Project Refinery, Inc. 32 Some Struts Sites: Government
33
Project Refinery, Inc. 33 Conservatives and Liberals Use It
34
WebWork □Introduction □Java Web Aplication Framework □Request-based Framework □Struts □ WebWork □Beehive, Stripes □Component-based Framework □Hybrid – Meta Framework □RIA-based Framework □Conclusion
35
WebWork □WebWork was originally developed by Rickard Oberg in 2001, and released as an open source project on SourceForge in March 2002. □WebWork provides robust support for building reusable UI templates, such as form controls, UI themes, internationalization, dynamic form parameter mapping to JavaBeans, and robust client and server side validation.
36
Component-based Framework □Introduction □Java Web Aplication Framework □Request-based Framework □ Component-based Framework □Hybrid – Meta Framework □RIA-based Framework □Conclusion
37
Component-based Framework □A Component-based Framework abstracts the internals of the request handling and encapsulates the logic into reusable components, often independent from the web medium □The state is automatically handled by the framework, based on the data that is present in each component instance. □Together with some form of event handling, this development model is very similar to the features offered by desktop GUI toolkits.
38
Component-based Framework □Introduction □Java Web Aplication Framework □Request-based Framework □Component-based Framework □JSF □Tapestry □Wicket □Hybrid – Meta Framework □RIA-based Framework □Conclusion
39
Component-based Framework □Introduction □Java Web Aplication Framework □Request-based Framework □Component-based Framework □ Jave Server Faces (JSF) □Tapestry □Wicket □Hybrid – Meta Framework □RIA-based Framework □Conclusion
40
Jave Server Faces (JSF) □JavaServer Faces (JSF) is a server-side user interface component framework for Java-based Web applications. □JSF contains an API for representing UI components and managing their state ; handling events, server- side validation, and data conversion ; defining page navigation ; supporting internationalization and accessibility ; and providing extensibility for all these features
41
JSF Solutions UI components State management Event handling Input validation Page navigation Internationalization and accessibility. Custom tag library
42
JSF Life Cycle
43
UI Components (Standard) Some of the standard JavaServer Faces Components
44
UI Components (Custom) Some custom JavaServer Faces Components
45
UI Components (Open Source) Some open source JavaServer Faces Components
46
UI Components (Third Party) Some third-party JavaServer Faces Components
47
UI Components (Code) Syntax for a text box component: Syntax for a calendar component: Syntax for a bean backed calendar component:
48
State Management □JSF maintains the state of components over several requests. □Example 1 □Example 2 □Code: □None Required
49
Event Handling □Method Bindings □Value Change Listeners □Command Actions □Action Listeners
50
Input Validation □Standard Validators □ □ f:validateDoubleRange □ f:validateLongRange □ f:validateLength □Custom Validators
51
Input Validation - Errors □Validation Errors □
52
Input Validation - Converters □Standard Converters □ □ f:convertNumber □ f:convertDateTime □Custom Converters □
53
Page Navigation □Struts-like config file navigation /index.jsp Success /thankyou.jsp Error /error.jsp
54
Internationalization and accessibility □Components and Converters support multiple locales □Resource Bundle Support □ □Define supported locales resources en fr es
55
Custom tag library □You have already seen it □html-basic.tld □jsf-core.tld
56
Gotchas Deployment Embedding HTML Components and Renderers Validation Bundle Keys “x.y.z”
57
Deployment □BEA WebLogic Server 8.1 SP3 □The JavaServer Faces required jars □commons-beanutils.jar □commons-collections.jar □commons-digester.jar □commons-logging.jar □jsf-api.jar □jsf-impl.jar □jstl.jar (must be version 1.0) □standard.jar (must be version 1.0)
58
Embedding HTML □HTML within JSF tags does not work without f:verbatim html □Use Exadels htmLib.jar instead
59
Components and Renderers □Building custom components □No simple task □Separate the renderer (easy to do)
60
Validation □If validation or conversion fails nothing happens □Action method bindings do not execute □Page just comes back □Most common JSF forum post □Use h:message or h:messages
61
Bundle Keys “x.y.z” □Resource Bundles are loaded as maps □ #{bundle.userslastname} – works □ #{bundle.user.name.last} – fails □ #{bundle[ ‘ user.name.last ’ ]} – works □For properties: □ #{bean.user.address.street} – works
62
Tool Support □Most IDEs have limited JSF support □The following IDEs provide the ability to drag and drop components onto a page: □IBM WSAD □Borland JBuilder □Oracle JDeveloper □Sun Java Studio Creator Eclipse*IntelliJ*JBuilderNetbeans* IBM WSADStudio CreatorJDeveloperNotepad**
63
MyEclipse – Drag and Drop
64
Political Support □Sun □Oracle □IBM □…and a bunch of little people but after those three it really doesn’t matter
65
Recommended Reading (the end)
66
Books Books I can recommend: □ Core JavaServer Faces by David Geary, Cay Horstmann □ JavaServer Faces in Action by Kito D. Mann Other books □ JavaServer Faces by Hans Bergsten □ Mastering JavaServer Faces by Bill Dudney, Jonathan Lehr, Bill Willis, LeRoy Mattingly □ JavaServer Faces Programming by Budi Kurniawan □ Javaserver Faces Kick Start (Kick Start) by James Turner, Craig McClanahan, Kunal Mittal
67
Sites □Sun Official JavaServer Faces Page http://java.sun.com/j2ee/javaserverfaces http://java.sun.com/j2ee/javaserverfaces □Sun Official JavaServer Faces Forum http://forum.java.sun.com/forum.jspa?forumID=427 http://forum.java.sun.com/forum.jspa?forumID=427 □Java Community Process JavaServer Faces Page http://www.jcp.org/en/jsr/detail?id=127 http://www.jcp.org/en/jsr/detail?id=127 □Sun Official JavaServer Faces implementation project https://javaserverfaces.dev.java.net/ https://javaserverfaces.dev.java.net/ □Components and resources □http://www.jsfcentral.com/http://www.jsfcentral.com/ □http://www.jamesholmes.com/JavaServerFaces/http://www.jamesholmes.com/JavaServerFaces/
68
Component-based Framework □Introduction □Java Web Aplication Framework □Request-based Framework □Component-based Framework □Jave Server Faces (JSF) □Tapestry □Wicket □Hybrid – Meta Framework □RIA-based Framework □Conclusion
69
Component-based Framework □Introduction □Java Web Aplication Framework □Request-based Framework □Component-based Framework □Jave Server Faces (JSF) □ Tapestry □ Wicket □Hybrid – Meta Framework □RIA-based Framework □Conclusion
70
Component-based Framework □Introduction □Java Web Aplication Framework □Request-based Framework □Component-based Framework □ Hybrid – Meta Framework □RIFE □Spring Framework □RIA-based Framework □Conclusion
71
Component-based Framework □Introduction □Java Web Aplication Framework □Request-based Framework □Component-based Framework □Hybrid – Meta Framework □ RIA-based Framework □Conclusion
72
Component-based Framework □Introduction □Java Web Aplication Framework □Request-based Framework □Component-based Framework □Hybrid – Meta Framework □ RIA-based Framework □DWR □Echo2 □JSON-RPC-Java □Conclusion
73
Java EE and.NET tiers
74
Java EE frameworks
75
References □T. C. Shan, W. W. Hua, “ Taxonomy of Java Web Application Frameworks,” in Conf. Rec. 1995 IEEE Int. Conf. on e-Business Engineering, pp. 378–385. □M. Fowler,” Patterns of Enterprise Application Architecture ”, Addison-Wesley, 2003. □Melek Oktay, Ayşe Betül Gülbağcı, Mustafa Sarıöz “ Architectural, Technological and Performance Issues in Enterprise Applications”, not published yet...
76
Thanks
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.