java web application framework waf l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Java Web Application Framework (WAF) PowerPoint Presentation
Download Presentation
Java Web Application Framework (WAF)

Loading in 2 Seconds...

play fullscreen
1 / 76

Java Web Application Framework (WAF) - PowerPoint PPT Presentation


  • 381 Views
  • Uploaded on

Java Web Application Framework (WAF). Melek OKTAY 50050403 moktay@fatih.edu.tr. Outline. Introduction Java Web Aplication Framework Conclusion. Outline. Introduction What is Framework What is WAF Java Web Aplication Framework Conclusion. What is Framework?. Introduction

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Java Web Application Framework (WAF)' - cid


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
java web application framework waf

Java Web Application Framework (WAF)

Melek OKTAY

50050403

moktay@fatih.edu.tr

outline
Outline
  • Introduction
  • Java Web Aplication Framework
  • Conclusion
outline3
Outline
  • Introduction
    • What is Framework
    • What is WAF
  • Java Web Aplication Framework
  • Conclusion
what is framework
What is Framework?
  • Introduction
    • What is Framework
    • What is WAF
  • Java Web Aplication Framework
  • Conclusion
what is framework5
What is Framework?
  • In information systems environment, a frameworkis a defined support structure in which other softwareapplications can be organized and developed.
  • A software framework is areusable design and building blocks for a softwaresystem and/or subsystem
what is framework cont
What is Framework? (cont.)
  • In anobject-oriented environment, a framework consists ofabstract and concrete classes. Instantiation of such aframework consists of composing and subclassing theexisting classes
  • Software frameworks rely on the HollywoodPrinciple: "Don’t call us, we’ll call you."
why we use framework
Why we use Framework?
  • The software frameworks significantly reduce theamount of time, effort, and resources required todevelop and maintain applications.
what is framework9
What is Framework?
  • Introduction
    • What is Framework
    • What is WAF
  • Java Web Aplication Framework
  • Conclusion
what is waf
What is WAF?
  • A Web Application Framework (WAF) is areusable, skeletal, semi-complete modular platformthat can be specialized to produce custom webapplications, which commonly serve the web browsersvia the Http's protocol.
  • WAF usually implementsthe Model-View-Controller (MVC) design pattern,typically in the Model 2 architecture to developrequest-response web-based applications on the JavaEE and .Net models.
what is waf cont
What is WAF? (cont.)
  • Model 1Architecture
what is waf cont12
What is WAF? (cont.)
  • Model 2Architecture
why we use waf
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.
why we use waf15
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.
slide16
Introduction
  • Java Web Aplication Framework
  • Conclusion
java web aplication framework
Java Web Aplication Framework
  • Introduction
  • Java Web Aplication Framework
    • Request-based Framework
    • Component-based Framework
    • Hybrid – Meta Framework
    • RIA-based Framework
  • Conclusion
request based framework
Request-based Framework
  • Introduction
  • Java Web Aplication Framework
    • Request-based Framework
    • Component-based Framework
    • Hybrid – Meta Framework
    • RIA-based Framework
  • Conclusion
request based framework19
Request-based Framework
  • A Request-based Framework is very close to theoriginal CGI specification.
  • It uses controllers andactions that directly handle incoming requests.
  • Eachrequest is essentially stateless.
request based framework20
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
request based framework21
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
struts
Struts
  • Struts was originally developed by CraigMcClanahan and donated to the Apache Foundation inMay 2000.
  • Struts has been a de facto framework with a strong and vibrant user community.
struts cont
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.
struts tag libraries
Struts Tag Libraries
  • HTML Tags
  • Bean Tags
  • Logic Tags
  • Template Tags
  • Custom Tags
struts html tags
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
struts html tags27
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
html tags typical html form
HTML Tags – Typical HTML Form
  • <HTML>
  • <BODY>
  • <FORM>
  • <TABLE WIDTH="100%">
  • <TR><TD>First Name</TD>
  • <TD><INPUT TYPE="TEXT" NAME="Name" SIZE="40" MAXLENGTH="40"></TD></TR>
  • <TR><TD>Street Address</TD>
  • <TD><INPUT TYPE="TEXT" NAME="Address" SIZE="40" MAXLENGTH="40"></TD></TR>
  • <TR><TD>City</TD>
  • <TD><INPUT TYPE="TEXT" NAME="City" SIZE="20" MAXLENGTH="20"></TD></TR>
  • <TR><TD>State</TD>
  • <TD><INPUT TYPE="TEXT" NAME="State" SIZE="2" MAXLENGTH="2"></TD></TR>
  • <TR><TD>Postal Code</TD>
  • <TD><INPUT TYPE="TEXT" NAME="ZipCode" SIZE="9" MAXLENGTH="9"></TD></TR>
  • <TR><TD ALIGN=CENTER><INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Save"></TD>
  • <TD><INPUT TYPE="RESET" NAME="Reset" VALUE="Cancel"></TD></TR>
  • </TABLE>
  • </FORM>
  • </BODY>
  • </HTML>

Project Refinery, Inc.

slide29

HTML Tags – Typical Struts Form

  • <HTML:HTML>
  • <BODY>
  • <HTML:FORM Action="/CustomerForm" focus=“name” >
  • <TABLE WIDTH="100%">
  • <TR><TD><bean:message key="customer.name"/></TD>
  • <TD><HTML:TEXT property="name" size="40" maxlength="40" /></TD></TR>
  • <TR><TD><bean:message key="customer.address"/></TD>
  • <TD><HTML:TEXT property="address" size ="40" maxlength ="40" /></TD></TR>
  • <TR><TD><bean:message key="customer.city"/></TD>
  • <TD><HTML:TEXT property="city" size ="20" maxlength ="20" /></TD></TR>
  • <TR><TD><bean:message key="customer.state"/></TD>
  • <TD><HTML:TEXT property="state" size ="2" maxlength ="2" /></TD></TR>
  • <TR><TD><bean:message key="customer.zip"/></TD>
  • <TD><HTML:TEXT property="zip" size ="9" maxlength ="9" /></TD></TR>
  • <TR><TD ALIGN=CENTER><html:submit property="action" value ="Save"/></TD>
  • <TD><html:reset property="action" value ="Reset"/></TD></TR>
  • </TABLE>
  • </HTML:FORM>
  • </BODY>
  • </HTML:HTML>

Project Refinery, Inc.

slide30

Application Set-up

  • Jar files
  • Tag libraries
  • Struts-config dtd
  • Application.properties
  • Apache vhost file
  • Web.xml
  • Struts-config.xml

Project Refinery, Inc.

slide31

Some Struts Sites: Travel

Project Refinery, Inc.

slide32

Some Struts Sites: Government

Project Refinery, Inc.

slide33

Conservatives and Liberals Use It

Project Refinery, Inc.

webwork
WebWork
  • Introduction
  • Java Web Aplication Framework
    • Request-based Framework
      • Struts
      • WebWork
      • Beehive , Stripes
    • Component-based Framework
    • Hybrid – Meta Framework
    • RIA-based Framework
  • Conclusion
webwork35
WebWork
  • WebWork was originally developed by RickardOberg in 2001, and released as an open source projectonSourceForge in March 2002.
  • WebWork provides robust support for buildingreusable UI templates, such as form controls, UIthemes, internationalization, dynamic form parametermapping to JavaBeans, and robust client and serverside validation.
component based framework
Component-based Framework
  • Introduction
  • Java Web Aplication Framework
    • Request-based Framework
    • Component-based Framework
    • Hybrid – Meta Framework
    • RIA-based Framework
  • Conclusion
component based framework37
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.
component based framework38
Component-based Framework
  • Introduction
  • Java Web Aplication Framework
    • Request-based Framework
    • Component-based Framework
      • JSF
      • Tapestry
      • Wicket
    • Hybrid – Meta Framework
    • RIA-based Framework
  • Conclusion
component based framework39
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
jave server faces jsf
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 pagenavigation; supporting internationalization and accessibility; and providing extensibility for all these features
jsf solutions
JSF Solutions
  • UI components
  • State management
  • Event handling
  • Input validation
  • Page navigation
  • Internationalization and accessibility.
  • Custom tag library
ui components standard
UI Components (Standard)

Some of the standard JavaServer Faces Components

ui components custom
UI Components (Custom)

Some custom JavaServer Faces Components

ui components open source
UI Components (Open Source)

Some open source JavaServer Faces Components

ui components third party
UI Components (Third Party)

Some third-party JavaServer Faces Components

ui components code
UI Components (Code)

Syntax for a text box component:

<h:inputText/>

Syntax for a calendar component:

<v:calendar/>

Syntax for a bean backed calendar component:

<v:calendar value=“#{bean.date}”/>

state management
State Management
  • JSF maintains the state of components over several requests.
    • Example 1
    • Example 2
  • Code:
    • None Required
event handling
Event Handling
  • Method Bindings<h:outputText value=“#{bundle.welcome}”rendered=“#{bean.showWelcome}”/>
  • Value Change Listeners<h:selectOneMenu value=“#{bean.type}” onchange=“submit()”immediate=“true”valueChangeListener=“#{bean.change}”> <f:selectItems value=“#{bean.types}”></h:selectOneMenu>
  • Command Actions<h:commandButton action=“#{bean.submit}”/>
  • Action Listeners<h:commandButton actionListener=“#{bean.listen}” action=“#{bean.submit}”/>
input validation
Input Validation
  • Standard Validators
    • <h:inputText id=“card” value=“#{bean.card}”required=“true”><f:validateLength minimum=“13”/></h:inputText>
    • f:validateDoubleRange
    • f:validateLongRange
    • f:validateLength
  • Custom Validators
input validation errors
Input Validation - Errors
  • Validation Errors
    • <h:message for=“card”/>
    • <h:messages/>
input validation converters
Input Validation - Converters
  • Standard Converters
    • <h:inputText value=“bean.date”> <f:convertDateTime pattern=“MM/dd/yyyy”/></h:inputText>
    • f:convertNumber
    • f:convertDateTime
  • Custom Converters
    • <h:inputText value=“bean.user” converter=“com.ihc.custom”>
page navigation
Page Navigation
  • Struts-like config file navigation

<navigation-rule>

<from-view-id>/index.jsp</from-view-id>

<navigation-case>

<from-outcome>Success</from-outcome>

<to-view-id>/thankyou.jsp</to-view-id>

</navigation-case>

<navigation-case>

<from-outcome>Error</from-outcome>

<to-view-id>/error.jsp</to-view-id>

</navigation-case>

</navigation-rule>

internationalization and accessibility
Internationalization and accessibility
  • Components and Converters support multiple locales
  • Resource Bundle Support
    • <f:loadBundle basename="resources" var="res"/>
    • Define supported locales

<application>

<message-bundle>resources</message-bundle>

<locale-config>

<default-locale>en</default-locale>

<supported-locale>fr</supported-locale>

<supported-locale>es</supported-locale>

</locale-config>

</application>

custom tag library
Custom tag library
  • You have already seen it
    • html-basic.tld <h:…/>
    • jsf-core.tld <f:…/>
gotchas
Gotchas
  • Deployment
  • Embedding HTML
  • Components and Renderers
  • Validation
  • Bundle Keys “x.y.z”
deployment
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)
embedding html
Embedding HTML
  • HTML within JSF tags does not work without f:verbatim

<h:panelGroup>

<f:verbatim>html</f:verbatim>

</h:panelGroup>

    • Use Exadels htmLib.jar instead
components and renderers
Components and Renderers
  • Building custom components
    • No simple task
    • Separate the renderer (easy to do)
validation
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
bundle keys x y z
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
tool support
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
political support
Political Support
  • Sun
  • Oracle
  • IBM
  • …and a bunch of little people but after those three it really doesn’t matter
books
Books

Books I can recommend:

  • Core JavaServer Facesby David Geary, Cay Horstmann
  • JavaServer Faces in Actionby Kito D. Mann

Other books

  • JavaServer Facesby Hans Bergsten
  • Mastering JavaServer Facesby Bill Dudney, Jonathan Lehr, Bill Willis, LeRoy Mattingly
  • JavaServer Faces Programmingby Budi Kurniawan
  • Javaserver Faces Kick Start (Kick Start)by James Turner, Craig McClanahan, Kunal Mittal
sites
Sites
  • Sun Official JavaServer Faces Page http://java.sun.com/j2ee/javaserverfaces
  • Sun Official JavaServer Faces Forumhttp://forum.java.sun.com/forum.jspa?forumID=427
  • Java Community Process JavaServer Faces Pagehttp://www.jcp.org/en/jsr/detail?id=127
  • Sun Official JavaServer Faces implementation projecthttps://javaserverfaces.dev.java.net/
  • Components and resources
    • http://www.jsfcentral.com/
    • http://www.jamesholmes.com/JavaServerFaces/
component based framework68
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
component based framework69
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

component based framework70
Component-based Framework

Introduction

Java Web Aplication Framework

Request-based Framework

Component-based Framework

Hybrid – Meta Framework

RIFE

Spring Framework

RIA-based Framework

Conclusion

component based framework71
Component-based Framework

Introduction

Java Web Aplication Framework

Request-based Framework

Component-based Framework

Hybrid – Meta Framework

RIA-based Framework

Conclusion

component based framework72
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

references
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...