O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Digital Java EE 7 Web Application Development

Book Description

Develop Java enterprise applications to meet the emerging digital standards using Java EE 7

About This Book

  • Build modern Java EE web applications that insert, update, retrieve, and delete customer data with up-to-date methodologies
  • Delve into the essential JavaScript programming language and become proficient with front-end technologies that integrate with the Java platform
  • Learn about JavaServer Faces, its lifecycle, and custom tags, and build exciting digital applications with the aid of handpicked, real-world examples

Who This Book Is For

If you are a professional Java engineer and want to develop well-rounded and strong Java Web Development skills, then this book is for you.

What You Will Learn

  • Understand and apply updated JavaServer Faces key features including HTML5 support, resource library constructs, and pass through attributes
  • Build web applications that conform to digital standards and governance, and leverage the Java EE 7 web architecture
  • Construct modern JSF Forms that apply validation, add AJAX for immediate validation, and write your own validators
  • Augment a traditional web application with JSF 2.2 Flow Beans and Flow Scope Beans
  • Program single page applications including AngularJS, and design Java RESTful back-end services for integration
  • Utilize modern web frameworks such as Bootstrap and Foundation in your JSF applications
  • Create your own JSF custom components that generate reusable content for your stakeholders and their businesses

In Detail

Digital Java EE 7 presents you with an opportunity to master writing great enterprise web software using the Java EE 7 platform with the modern approach to digital service standards.

You will first learn about the lifecycle and phases of JavaServer Faces, become completely proficient with different validation models and schemes, and then find out exactly how to apply AJAX validations and requests. Next, you will touch base with JSF in order to understand how relevant CDI scopes work. Later, you'll discover how to add finesse and pizzazz to your digital work in order to improve the design of your e-commerce application. Finally, you will deep dive into AngularJS development in order to keep pace with other popular choices, such as Backbone and Ember JS.

By the end of this thorough guide, you'll have polished your skills on the Digital Java EE 7 platform and be able to creat exiting web application.

Style and approach

This book takes a step-by-step and detailed approach, coaching you through real-world scenarios. The book's style is designed for those who enjoy a thorough educational approach.

Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Digital Java EE 7 Web Application Development
    1. Table of Contents
    2. Digital Java EE 7 Web Application Development
    3. Credits
    4. About the Author
    5. Acknowledgment
    6. About the Reviewers
    7. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    8. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    9. 1. Digital Java EE 7
      1. Working in the digital domain
      2. Digital Java developer requirements
      3. Java in the picture
      4. The impressive growth of JavaScript
        1. The JavaScript module pattern
        2. JavaScript advanced libraries
      5. Information architecture and user experience
      6. Java EE 7 architecture
        1. Standard platform components and API
      7. Xentracker JavaServer Faces
      8. Application servers
      9. Summary
      10. Exercises
    10. 2. JavaServer Faces Lifecycle
      1. Introduction to JSF
        1. JSF 1.0 and 2.0 history
        2. Key JSF 2.2 features
        3. Why choose JSF over alternatives?
      2. The MVC design pattern
        1. MVC in JSF
      3. Facelets
      4. The request processing lifecycle
        1. The execute and render lifecycle
          1. Restore View
          2. Apply Request Values
          3. Process Validations
          4. Update Model Values
          5. Invoke Application
          6. Render Response
          7. Event handling
      5. A basic JSF example
        1. A web deployment descriptor
        2. JSF XML namespaces
      6. A Composition example
        1. JSF serving resources
      7. Expression language
        1. Immediate and deferred expressions
        2. Value expressions
          1. Map expressions
          2. List expressions
          3. Resolving the initial term
        3. Method expressions
          1. Parameterized method expressions
        4. Arithmetic expressions
      8. Page navigation
        1. The navigation rules
        2. Wildcards
        3. Conditional navigation
        4. Static navigation
      9. Summary
      10. Exercises
    11. 3. Building JSF Forms
      1. Create, Retrieve, Update, and Delete
        1. A basic create entity JSF form
          1. The JSF HTML output label
          2. The JSF HTML input text
          3. The JSF HTML select one menu
          4. The JSF HTML select Boolean checkbox
          5. The JSF HTML command button
        2. The backing bean controller
        3. Data service
      2. JSF custom tags
        1. The HTML render kit custom tags
        2. The core JSF custom tags
        3. The template composition custom tags
        4. Common attributes
      3. Displaying a list collection of objects
        1. Enhanced date time entry
      4. Editing data
      5. Removing data
      6. JSF and CDI scopes
        1. Bean scopes
      7. Summary
      8. Exercises
    12. 4. JSF Validation and AJAX
      1. Validation methods
        1. Server-side validation
        2. Client-side validation
      2. Faces messages
      3. Validation
        1. Constraining form content with Bean Validation
        2. Validating user input with JSF
          1. Customizing JSF validation
          2. Custom validation methods
          3. Defining custom validators
          4. Validating groups of properties
        3. Converters
        4. Validating immediately with AJAX
        5. Validating groups of input fields
        6. AJAX custom tag in depth
      4. A partial JSF lifecycle
      5. Handling views
        1. Invoking controller methods
          1. Parameterized method invocations
          2. Passing parameters to the controller
          3. Invoking an action event listener
        2. Redirection pages
        3. Debugging the JSF content
      6. Summary
      7. Exercises
    13. 5. Conversations and Journeys
      1. Digital e-commerce applications
      2. Conversational scope
        1. Conversation timeout and serialization
      3. The conversation scope controller
        1. The Entity-Control-Boundary design pattern
        2. The customer journey
        3. Entity classes
        4. Data service
      4. Page views
        1. An initial page view
        2. Getting started page view
        3. Contact details page view
        4. Your rate page view
          1. HTML5 friendly support
          2. Using AJAX for a partial update
          3. Binding components
          4. Updating areas with AJAX partial updates
        5. The address page view
        6. The confirmation page view
        7. The completion page view
        8. Utility classes
      5. Composite custom components
        1. Components with XHTML
        2. Composite components and custom components
        3. Composite component with self-generating tag
      6. Summary
      7. Exercises
    14. 6. JSF Flows and Finesse
      1. What is Faces Flow?
      2. Flow definitions and lifecycle
      3. Simple Implicit Faces Flows
        1. Implicit navigation
        2. A Flow scoped bean
        3. Facelet views
      4. Handling view expired
        1. A comparison with conversational scoped beans
        2. Capturing the lifecycle of flow scoped beans
      5. Declarative and nested flows
        1. The flow node terminology
        2. An XML flow definition description file
          1. A flow definition tag
          2. A mandatory flow return tag
          3. A view page tag
          4. An optional start page tag
          5. Switch, conditional, and case tags
        3. A nested flow example
          1. XML flow definitions
          2. Flow beans
          3. Page views
      6. A real-world example
        1. Ensure the application populates the database
        2. Securing page views and flows
      7. Resource Library Contracts
        1. Static Resource Library Contract references
        2. Dynamic Resource Library Contract references
      8. Advice for flows
      9. Summary
      10. Exercises
    15. 7. Progressive JavaScript Frameworks and Modules
      1. JavaScript essentials
        1. Creating objects
          1. The console log
        2. Writing JavaScript object constructors
        3. The JavaScript property notations
        4. Dealing with a null and undefined reference pointer
        5. The JavaScript truth
        6. Runtime type information
        7. The JavaScript functions
      2. Introducing the jQuery framework
        1. Including jQuery in a JSF application
        2. jQuery ready function callbacks
        3. Acting on the jQuery selectors
          1. Manipulating the DOM elements
          2. Animation
      3. The RequireJS framework
        1. A RequireJS configuration
        2. An application module
        3. Defining modules
      4. UnderscoreJS
        1. The for-each operations
        2. The filter operations
        3. The map operations
        4. The flatten operations
        5. The reduction operations
      5. GruntJS
      6. Summary
      7. Exercises
    16. 8. AngularJS and Java RESTful Services
      1. Single-page applications
      2. The caseworker application
      3. AngularJS
        1. How does AngularJS work?
      4. Caseworker overview
        1. Caseworker main view
      5. Project organization
      6. Application main controller
      7. New case record controller
        1. The case record modal view template
      8. New task record controller
        1. The task modal view template
      9. State change
        1. Controller code
        2. The template view code
        3. Toggling the task display state
      10. Server-side Java
        1. Entity objects
        2. RESTful communication
          1. Retrieval of case records
          2. Creating a case record
          3. Updating a case record
          4. Creating a task record
          5. Updating a task record
          6. Deleting a task record
        3. WebSocket communication
          1. AngularJS client side
          2. Server-side WebSocket endpoints
      11. Consider your design requirements
        1. Array collection of single-page applications
        2. Hierarchical collection of single-page applications
      12. Summary
      13. Exercises
    17. 9. Java EE MVC Framework
      1. Java EE 8 MVC
      2. MVC controllers
        1. MVC page views and templates
        2. MVC models
        3. Response and redirects
          1. Reconfiguring the view root
      3. Handlebars Java
        1. A compiled-inline template servlet
        2. Template expressions in Handlebars
        3. The welcome controller
        4. The custom view engine
        5. The product controller
          1. Block expressions
          2. The retrieve and edit operations
          3. The JAX-RS global validation
        6. An MVC binding result validation
      4. Design considerations
        1. Majority server-side templating
        2. Majority client-side templating
        3. Shared templating
      5. Summary
      6. Exercises
    18. A. JSF with HTML5, Resources, and Faces Flows
      1. An HTML5 friendly markup
        1. The pass-through attributes
        2. The pass-through elements
      2. Resource identifiers
      3. Resource Library Contracts
      4. A Faces servlet
        1. Reconfiguration of the resource paths
        2. A JSF-specific configuration
      5. Internationalization
        1. Resource bundles
        2. Message bundles
        3. A browser configured locale
        4. An application controlled locale
        5. An individual page controlled locale
      6. A web deployment descriptor
      7. Programmatic Faces Flows
        1. View types
      8. The Faces Flows programmatic interface
        1. ViewNode
        2. ReturnNode
        3. MethodCall
        4. FlowCall
        5. SwitchNode
        6. NavigationCase node
        7. Builder types
    19. B. From Request to Response
      1. HTTP
        1. An HTTP request
        2. An HTTP response
      2. Java Enterprise Architectures
        1. Standard Java EE web architecture
        2. Extended architectures
        3. Containerless systems
        4. Microservices
      3. To be full stack or not
    20. C. Agile Performance – Working inside Digital Teams
      1. Digital teams and adaptation
      2. Roles
        1. The development perspective
          1. A Java engineer
          2. An interface developer engineer
          3. Quality assurance tester
          4. Software in developer test
        2. The design perspective
          1. A creative designer
          2. A usability experience engineer
          3. A content strategist
        3. The architectural perspective
          1. A data scientist
          2. A technical architect
        4. The management perspective
          1. A business analyst and liaison officer
          2. A project manager/scrum master
          3. A digital development manager
      3. Software quality
      4. Class versus form
    21. D. Curated References
      1. Service delivery
      2. Agile and leadership
      3. Architecture
      4. User interface
      5. Java EE and JVM technology
    22. Index