Dwin1 2.Que Es Waf

Embed Size (px)

Citation preview

  • 7/28/2019 Dwin1 2.Que Es Waf

    1/86

    Java Web Application

    Framework (WAF)

    Melek OKTAY

    [email protected]

  • 7/28/2019 Dwin1 2.Que Es Waf

    2/86

    Outline

    Introduction

    Java Web Aplication Framework

    Conclusion

  • 7/28/2019 Dwin1 2.Que Es Waf

    3/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    4/86

    What is Framework?

    Introduction

    What is Framework

    What is WAF

    Java Web Aplication Framework

    Conclusion

  • 7/28/2019 Dwin1 2.Que Es Waf

    5/86

    What is Framework?

    In information systems environment, a framework isa defined support structure in which other softwareapplications can be organized and developed.

    A software framework is a reusable design andbuilding blocks for a software system and/orsubsystem

  • 7/28/2019 Dwin1 2.Que Es Waf

    6/86

    What is Framework? (cont.)

    In an object-oriented environment, a frameworkconsists of abstract and concrete classes.Instantiation of such a framework consists ofcomposing and subclassing the existing classes

    Software frameworks rely on the HollywoodPrinciple: "Dont call us, well call you."

  • 7/28/2019 Dwin1 2.Que Es Waf

    7/86

    What is Framework? (cont.)

  • 7/28/2019 Dwin1 2.Que Es Waf

    8/86

    Why we use Framework?

    The software frameworks significantly reduce theamount of time, effort, and resources required todevelop and maintain applications.

  • 7/28/2019 Dwin1 2.Que Es Waf

    9/86

    What is Framework?

    Introduction

    What is Framework

    What is WAF

    Java Web Aplication Framework

    Conclusion

  • 7/28/2019 Dwin1 2.Que Es Waf

    10/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    11/86

    What is WAF? (cont.)

    Model 1Architecture

  • 7/28/2019 Dwin1 2.Que Es Waf

    12/86

    What is WAF? (cont.)

    Model 2Architecture

  • 7/28/2019 Dwin1 2.Que Es Waf

    13/86

    Model-View-Controller

  • 7/28/2019 Dwin1 2.Que Es Waf

    14/86

    Why we use WAF?

    Virtually all web applications have a common set ofbasic requirements, such as user management e.g.,secure user login, password recovery), groupmanagement, and access authorization.

    A Web Application Framework usually includes allthese functionalities, refined through hundreds ofproduction deployments, freeing developers to

    focus on the needs of their specific application.

  • 7/28/2019 Dwin1 2.Que Es Waf

    15/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    16/86

    Introduction

    Java Web Aplication Framework

    Conclusion

  • 7/28/2019 Dwin1 2.Que Es Waf

    17/86

    Java Web Aplication Framework

    Introduction

    Java Web Aplication Framework

    Request-based Framework

    Component-based Framework

    HybridMeta Framework

    RIA-based Framework

    Conclusion

  • 7/28/2019 Dwin1 2.Que Es Waf

    18/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    19/86

    Request based frameworkis basically a webframework that gets user's request then determinewhat the system should do and give back theresponse back to the user. So basically as you can

    see, the flow is pretty much linear.

  • 7/28/2019 Dwin1 2.Que Es Waf

    20/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    21/86

    Hybrid Framework: The framework combines bothrequest-based and component-based frameworksby taking control of the entire data and logic flow ina request-based model.

  • 7/28/2019 Dwin1 2.Que Es Waf

    22/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    23/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    24/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    25/86

    Request-based Framework

    A Request-based Framework is very close to theoriginal CGI specification.

    It uses controllers and actions that directly handleincoming requests.

    Each request is essentially stateless.

  • 7/28/2019 Dwin1 2.Que Es Waf

    26/86

    Request-based Framework

    Introduction

    Java Web Aplication Framework Request-based Framework

    Struts

    WebWork

    Beehive , Stripes

    Component-based Framework

    HybridMeta Framework

    RIA-based Framework

    Conclusion

  • 7/28/2019 Dwin1 2.Que Es Waf

    27/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    28/86

    Struts

    Struts was originally developed by CraigMcClanahan and donated to the ApacheFoundation in May 2000.

    Struts has been a de facto framework with a strongand vibrant user community.

  • 7/28/2019 Dwin1 2.Que Es Waf

    29/86

    Struts (cont.)

    Struts uses and extends the Java Servlet API toadopt the "Model 2" approach, a variation of theclassic Model-View-Controller (MVC) designpattern.

  • 7/28/2019 Dwin1 2.Que Es Waf

    30/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    31/86

    Struts Tag Libraries

    HTML Tags

    Bean Tags

    Logic Tags

    Template Tags Custom Tags

  • 7/28/2019 Dwin1 2.Que Es Waf

    32/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    33/86

    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 withembedded

    option

    options

    submit buttons

    text input fields

    textareas

  • 7/28/2019 Dwin1 2.Que Es Waf

    34/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    35/86

    Project Refinery, Inc. 35

    HTML TagsTypical Struts Form

  • 7/28/2019 Dwin1 2.Que Es Waf

    36/86

    Project Refinery, Inc. 36

    Application Set-up

    Jar files

    Tag libraries

    Struts-config dtd

    Application.properties

    Apache vhost file

    Web.xml

    Struts-config.xml

  • 7/28/2019 Dwin1 2.Que Es Waf

    37/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    38/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    39/86

    Project Refinery, Inc. 39

    Conservatives and Liberals Use It

  • 7/28/2019 Dwin1 2.Que Es Waf

    40/86

    Links

    http://www.webtaller.com/construccion/lenguajes/java/lecciones/como-crear-aplicacion-struts-paso-a-paso-java.php

  • 7/28/2019 Dwin1 2.Que Es Waf

    41/86

    WebWork

    Introduction

    Java Web Aplication Framework Request-based Framework

    Struts

    WebWork Beehive , Stripes

    Component-based Framework

    HybridMeta Framework

    RIA-based Framework

    Conclusion

  • 7/28/2019 Dwin1 2.Que Es Waf

    42/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    43/86

    Links

    http://www.webtaller.com/construccion/lenguajes/java/lecciones/como-crear-aplicacion-struts-paso-a-paso-

    java.php

  • 7/28/2019 Dwin1 2.Que Es Waf

    44/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    45/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    46/86

    Component-based Framework

    Introduction

    Java Web Aplication Framework Request-based Framework

    Component-based Framework JSF Tapestry

    Wicket

    HybridMeta Framework

    RIA-based Framework

    Conclusion

  • 7/28/2019 Dwin1 2.Que Es Waf

    47/86

    Component-based Framework

    Introduction Java Web Aplication Framework

    Request-based Framework Component-based Framework

    Jave Server Faces (JSF) Tapestry Wicket

    HybridMeta Framework

    RIA-based Framework

    Conclusion

  • 7/28/2019 Dwin1 2.Que Es Waf

    48/86

    Jave Server Faces (JSF)

    JavaServer Faces (JSF) is a server-side user interfacecomponent framework for Java-based Webapplications.

    JSF contains an API for representing UI componentsand managing their state; handling events, server-side validation, and data conversion; defining pagenavigation; supporting internationalization and

    accessibility; and providing extensibility for all thesefeatures

  • 7/28/2019 Dwin1 2.Que Es Waf

    49/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    50/86

    JSF Life Cycle

  • 7/28/2019 Dwin1 2.Que Es Waf

    51/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    52/86

    UI Components (Custom)

    Some custom JavaServer Faces Components

  • 7/28/2019 Dwin1 2.Que Es Waf

    53/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    54/86

    UI Components (Third Party)

    Some third-party JavaServer Faces Components

  • 7/28/2019 Dwin1 2.Que Es Waf

    55/86

    UI Components (Code)

    Syntax for a text box component:

    Syntax for a calendar component:

    Syntax for a bean backed calendarcomponent:

  • 7/28/2019 Dwin1 2.Que Es Waf

    56/86

    State Management

    JSF maintains the state of componentsover several requests.

    Example 1 Example 2

    Code: None Required

  • 7/28/2019 Dwin1 2.Que Es Waf

    57/86

    Links CRUD in JSF

    http://www.youtube.com/watch?feature=player_embedded&v=m2BaAV9ru

    RE

    http://www.youtube.com/watch?feature=player_embedded&v=m2BaAV9ruREhttp://www.youtube.com/watch?feature=player_embedded&v=m2BaAV9ruREhttp://www.youtube.com/watch?feature=player_embedded&v=m2BaAV9ruREhttp://www.youtube.com/watch?feature=player_embedded&v=m2BaAV9ruREhttp://www.youtube.com/watch?feature=player_embedded&v=m2BaAV9ruREhttp://www.youtube.com/watch?feature=player_embedded&v=m2BaAV9ruRE
  • 7/28/2019 Dwin1 2.Que Es Waf

    58/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    59/86

    Input Validation

    Standard Validators

    f:validateDoubleRange

    f:validateLongRange

    f:validateLength

    Custom Validators

  • 7/28/2019 Dwin1 2.Que Es Waf

    60/86

    Input Validation - Errors

    Validation Errors

  • 7/28/2019 Dwin1 2.Que Es Waf

    61/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    62/86

    Internationalization and

  • 7/28/2019 Dwin1 2.Que Es Waf

    63/86

    Internationalization and

    accessibility

    Components and Converters support multiplelocales

    Resource Bundle Support

    Define supported localesresources

    en

    fr

    es

  • 7/28/2019 Dwin1 2.Que Es Waf

    64/86

    Custom tag library

    You have already seen it

    html-basic.tld

    jsf-core.tld

  • 7/28/2019 Dwin1 2.Que Es Waf

    65/86

    Gotchas

    Deployment

    Embedding HTML

    Components and Renderers

    Validation

    Bundle Keys x.y.z

  • 7/28/2019 Dwin1 2.Que Es Waf

    66/86

  • 7/28/2019 Dwin1 2.Que Es Waf

    67/86

    Link WebLogic

    http://www.okdba.com/en/schnews/2011/0411/372.html

    http://www.okdba.com/en/schnews/2011/0411/372.htmlhttp://www.okdba.com/en/schnews/2011/0411/372.htmlhttp://www.okdba.com/en/schnews/2011/0411/372.htmlhttp://www.okdba.com/en/schnews/2011/0411/372.html
  • 7/28/2019 Dwin1 2.Que Es Waf

    68/86

    Embedding HTML

    HTML within JSF tags does not workwithout f:verbatim

    html

    Use Exadels htmLib.jar instead

  • 7/28/2019 Dwin1 2.Que Es Waf

    69/86

    Components and Renderers

    Building custom components

    No simple task

    Separate the renderer (easy to do)

  • 7/28/2019 Dwin1 2.Que Es Waf

    70/86

    Validation

    If validation or conversion fails nothinghappens

    Action method bindings do not execute

    Page just comes back

    Most common JSF forum post

    Use h:message orh:messages

  • 7/28/2019 Dwin1 2.Que Es Waf

    71/86

    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

  • 7/28/2019 Dwin1 2.Que Es Waf

    72/86

    Tool Support

    Most IDEs have limited JSF support

    The following IDEs provide the ability todrag and drop components onto apage:

    IBM WSAD

    Borland JBuilder

    Oracle JDeveloper

    Sun Java Studio Creator

    Netbeans too

    Eclipse* IntelliJ* JBuilder Netbeans*

    IBM WSAD Studio Creator JDeveloper Notepad**

  • 7/28/2019 Dwin1 2.Que Es Waf

    73/86

    MyEclipseDrag and Drop

  • 7/28/2019 Dwin1 2.Que Es Waf

    74/86

    Political Support

    Sun

    Oracle

    IBM

    and a bunch of little people butafter those three it really doesntmatter

  • 7/28/2019 Dwin1 2.Que Es Waf

    75/86

    Recommended Reading

    (the end)

  • 7/28/2019 Dwin1 2.Que Es Waf

    76/86

    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

  • 7/28/2019 Dwin1 2.Que Es Waf

    77/86

    Sites

    Sun Official JavaServer Faces Pagehttp://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 implementationprojecthttps://javaserverfaces.dev.java.net/

    Components and resources http://www.jsfcentral.com/

    http://www.jamesholmes.com/JavaServerFaces/

    http://java.sun.com/j2ee/javaserverfaceshttp://forum.java.sun.com/forum.jspa?forumID=427http://www.jcp.org/en/jsr/detail?id=127https://javaserverfaces.dev.java.net/http://www.jsfcentral.com/http://www.jamesholmes.com/JavaServerFaces/http://www.jamesholmes.com/JavaServerFaces/http://www.jsfcentral.com/https://javaserverfaces.dev.java.net/http://www.jcp.org/en/jsr/detail?id=127http://forum.java.sun.com/forum.jspa?forumID=427http://java.sun.com/j2ee/javaserverfaces
  • 7/28/2019 Dwin1 2.Que Es Waf

    78/86

    Component-based Framework

    Introduction Java Web Aplication Framework

    Request-based Framework

    Component-based Framework Jave Server Faces (JSF)

    Tapestry

    Wicket

    HybridMeta Framework

    RIA-based Framework

    Conclusion

  • 7/28/2019 Dwin1 2.Que Es Waf

    79/86

    Component-based Framework

    Introduction Java Web Aplication Framework

    Request-based Framework Component-based Framework

    Jave Server Faces (JSF) Tapestry Wicket

    HybridMeta Framework RIA-based Framework

    Conclusion

  • 7/28/2019 Dwin1 2.Que Es Waf

    80/86

    Component-based Framework

    Introduction

    Java Web Aplication Framework

    Request-based Framework

    Component-based Framework Hybrid Meta Framework

    RIFE

    Spring Framework

    RIA-based Framework

    Conclusion

  • 7/28/2019 Dwin1 2.Que Es Waf

    81/86

    Component-based Framework

    Introduction

    Java Web Aplication Framework

    Request-based Framework

    Component-based Framework

    HybridMeta Framework

    RIA-based Framework

    Conclusion

    C

  • 7/28/2019 Dwin1 2.Que Es Waf

    82/86

    Component-based Framework

    Introduction Java Web Aplication Framework

    Request-based Framework

    Component-based Framework

    HybridMeta Framework

    RIA-based Framework DWR

    Echo2

    JSON-RPC-Java

    Conclusion

  • 7/28/2019 Dwin1 2.Que Es Waf

    83/86

    Java EE and .NET tiers

  • 7/28/2019 Dwin1 2.Que Es Waf

    84/86

    Java EE frameworks

    R f

  • 7/28/2019 Dwin1 2.Que Es Waf

    85/86

    References

    T. C. Shan, W. W. Hua, Taxonomy of Java Web ApplicationFrameworks, in Conf. Rec. 1995 IEEE Int. Conf. on e-BusinessEngineering, pp. 378385.

    M. Fowler,Patterns of Enterprise Application Architecture,

    Addison-Wesley, 2003.

    Melek Oktay, Aye Betl Glbac, Mustafa SarzArchitectural, Technological and Performance Issues inEnterprise Applications,not published yet...

  • 7/28/2019 Dwin1 2.Que Es Waf

    86/86

    Thanks