You are previewing Professional Java for Web Applications.
O'Reilly logo
Professional Java for Web Applications

Book Description

The comprehensive Wrox guide for creating Java web applications for the enterprise

This guide shows Java software developers and software engineers how to build complex web applications in an enterprise environment. You'll begin with an introduction to the Java Enterprise Edition and the basic web application, then set up a development application server environment, learn about the tools used in the development process, and explore numerous Java technologies and practices. The book covers industry-standard tools and technologies, specific technologies, and underlying programming concepts.

  • Java is an essential programming language used worldwide for both Android app development and enterprise-level corporate solutions

  • As a step-by-step guide or a general reference, this book provides an all-in-one Java development solution

  • Explains Java Enterprise Edition 7 and the basic web application, how to set up a development application server environment, which tools are needed during the development process, and how to apply various Java technologies

  • Covers new language features in Java 8, such as Lambda Expressions, and the new Java 8 Date & Time API introduced as part of JSR 310, replacing the legacy Date and Calendar APIs

  • Demonstrates the new, fully-duplex WebSocket web connection technology and its support in Java EE 7, allowing the reader to create rich, truly interactive web applications that can push updated data to the client automatically

  • Instructs the reader in the configuration and use of Log4j 2.0, Spring Framework 4 (including Spring Web MVC), Hibernate Validator, RabbitMQ, Hibernate ORM, Spring Data, Hibernate Search, and Spring Security

  • Covers application logging, JSR 340 Servlet API 3.1, JSR 245 JavaServer Pages (JSP) 2.3 (including custom tag libraries), JSR 341 Expression Language 3.0, JSR 356 WebSocket API 1.0, JSR 303/349 Bean Validation 1.1, JSR 317/338 Java Persistence API (JPA) 2.1, full-text searching with JPA, RESTful and SOAP web services, Advanced Message Queuing Protocol (AMQP), and OAuth

  • Professional Java for Web Applications is the complete Wrox guide for software developers who are familiar with Java and who are ready to build high-level enterprise Java web applications.

    Table of Contents

    1. Part I: Creating Enterprise Applications
      1. Chapter 1: Introducing Java Platform, Enterprise Edition
        1. A Timeline of Java Platforms
        2. Understanding the Basic Web Application Structure
        3. Summary
      2. Chapter 2: Using Web Containers
        1. Choosing a Web Container
        2. Installing Tomcat on Your Machine
        3. Deploying and Undeploying Applications in Tomcat
        4. Debugging Tomcat from Your IDE
        5. Summary
      3. Chapter 3: Writing Your First Servlet
        1. Creating a Servlet Class
        2. Configuring a Servlet for Deployment
        3. Understanding doGet(), doPost(), and Other Methods
        4. Using Parameters and Accepting Form Submissions
        5. Configuring your Application Using Init Parameters
        6. Uploading Files from a Form
        7. Making Your Application Safe for Multithreading
        8. Summary
      4. Chapter 4: Using JSPs to Display Content
        1. <br /> Is Easier Than output.println(“<br />”)
        2. Creating Your First JSP
        3. Using Java within a JSP (and Why You Shouldn’t!)
        4. Combining Servlets and JSPs
        5. A Note about JSP Documents (JSPX)
        6. Summary
      5. Chapter 5: Maintaining State Using Sessions
        1. Understanding Why Sessions Are Necessary
        2. Using Session Cookies and URL Rewriting
        3. Storing Data in a Session
        4. Applying Sessions Usefully
        5. Clustering an Application That Uses Sessions
        6. Summary
      6. Chapter 6: Using the Expression Language in JSPs
        1. Understanding Expression Language
        2. Writing with the EL Syntax
        3. Using Scoped Variables in EL Expressions
        4. Accessing Collections with the Stream API
        5. Replacing Java Code with Expression Language
        6. Summary
      7. Chapter 7: Using the Java Standard Tag Library
        1. Introducing JSP Tags and the JSTL
        2. Using the Core Tag Library (C Namespace)
        3. Using the Internationalization and Formatting Tag Library (FMT Namespace)
        4. Using the Database Access Tag Library (SQL Namespace)
        5. Using the XML Processing Tag Library (X Namespace)
        6. Replacing Java Code with JSP Tags
        7. Summary
      8. Chapter 8: Writing Custom Tag and Function Libraries
        1. Understanding TLDs, Tag Files, and Tag Handlers
        2. Creating Your First Tag File to Serve as an HTML Template
        3. Creating a More Useful Date Formatting Tag Handler
        4. Creating an EL Function to Abbreviate Strings
        5. Replacing Java Code with Custom JSP Tags
        6. Summary
      9. Chapter 9: Improving Your Application Using Filters
        1. Understanding the Purpose of Filters
        2. Creating, Declaring, and Mapping Filters
        3. Ordering Your Filters Properly
        4. Investigating Practical Uses for Filters
        5. Simplifying Authentication with a Filter
        6. Summary
      10. Chapter 10: Making Your Application Interactive with WebSockets
        1. Evolution: From Ajax to WebSockets
        2. Understanding the WebSocket APIs
        3. Creating Multiplayer Games with WebSockets
        4. Using WebSockets to Communicate in a Cluster
        5. Adding “Chat with Support” to the Customer Support Application
        6. Summary
      11. Chapter 11: Using Logging to Monitor Your Application
        1. Understanding the Concepts of Logging
        2. Using Logging Levels and Categories
        3. Choosing a Logging Framework
        4. Integrating Logging into Your Application
        5. Summary
    2. Part II: Adding Spring Framework Into the Mix
      1. Chapter 12: Introducing Spring Framework
        1. What Is Spring Framework?
        2. Why Spring Framework?
        3. Understanding Application Contexts
        4. Bootstrapping Spring Framework
        5. Configuring Spring Framework
        6. Utilizing Bean Definition Profiles
        7. Summary
      2. Chapter 13: Replacing Your Servlets with Controllers
        1. Understanding @RequestMapping
        2. Using Spring Framework’s Model and View Pattern
        3. Making Your Life Easier with Form Objects
        4. Updating the Customer Support Application
        5. Summary
      3. Chapter 14: Using Services and Repositories to Support Your Controllers
        1. Understanding Model-View-Controller Plus Controller-Service-Repository
        2. Using the Root Application Context Instead of a Web Application Context
        3. Improving Services with Asynchronous and Scheduled Execution
        4. Applying Logic Layer Separation to WebSockets
        5. Summary
      4. Chapter 15: Internationalizing Your Application with Spring Framework i18n
        1. Why Do You Need Spring Framework i18n?
        2. Using the Basic Internationalization and Localization APIs
        3. Configuring Internationalization in Spring Framework
        4. Internationalizing Your Code
        5. Summary
      5. Chapter 16: Using JSR 349, Spring Framework, and Hibernate Validator for Bean Validation
        1. What Is Bean Validation?
        2. Configuring Validation in the Spring Framework Container
        3. Adding Constraint Validation Annotations to Your Beans
        4. Configuring Spring Beans for Method Validation
        5. Writing Your Own Validation Constraints
        6. Integrating Validation in the Customer Support Application
        7. Summary
      6. Chapter 17: Creating RESTful and SOAP Web Services
        1. Understanding Web Services
        2. Configuring RESTful Web Services with Spring MVC
        3. Testing Your Web Service Endpoints
        4. Using Spring Web Services for SOAP
        5. Summary
      7. Chapter 18: Using Messaging and Clustering for Flexibility and Reliability
        1. Recognizing When You Need Messaging and Clustering
        2. Adding Messaging Support to your Application
        3. Making your Messaging Distributable Across a Cluster
        4. Distributing Events with AMQP
        5. Summary
    3. Part III: Persisting Data with JPA and Hibernate ORM
      1. Chapter 19: Introducing Java Persistence API and Hibernate ORM
        1. What Is Data Persistence?
        2. What Is an Object-Relational Mapper?
        3. A Brief Look at Hibernate ORM
        4. Preparing a Relational Database
        5. A Note About Maven Dependencies
        6. Summary
      2. Chapter 20: Mapping Entities to Tables with JPA Annotations
        1. Getting Started with Simple Entities
        2. Creating and Using a Persistence Unit
        3. Mapping Complex Data Types
        4. Summary
      3. Chapter 21: Using JPA in Spring Framework Repositories
        1. Using Spring Repositories and Transactions
        2. Configuring Persistence in Spring Framework
        3. Creating and Using JPA Repositories
        4. Converting data with DTOs and Entities
        5. Summary
      4. Chapter 22: Eliminating Boilerplate Repositories with Spring Data JPA
        1. Understanding Spring Data’s Unified Data Access
        2. Configuring and Creating Spring Data JPA Repositories
        3. Refactoring the Customer Support Application
        4. Summary
      5. Chapter 23: Searching for Data with JPA and Hibernate Search
        1. An Introduction to Searching
        2. Using Advanced Criteria to Locate Objects
        3. Taking Advantage of Full-Text Indexes with JPA
        4. Indexing Any Data with Apache Lucene and Hibernate Search
        5. Summary
      6. Chapter 24: Creating Advanced Mappings and Custom Data Types
        1. What’s Left?
        2. Converting Nonstandard Data Types
        3. Embedding POJOs within Entities
        4. Defining Relationships between Entities
        5. Addressing Other Common Situations
        6. Creating Programmatic Triggers
        7. Refining the Customer Support Application
        8. Summary
    4. Part IV: Securing Your Application with Spring Security
      1. Chapter 25: Introducing Spring Security
        1. What Is Authentication?
        2. Why Spring Security?
        3. Summary
      2. Chapter 26: Authenticating Users with Spring Security
        1. Choosing and Configuring an Authentication Provider
        2. Writing Your Own Authentication Provider
        3. Summary
      3. Chapter 27: Using Authorization Tags and Annotations
        1. Authorizing by Declaration
        2. Understanding Authorization Decisions
        3. Creating Access Control Lists for Object Security
        4. Adding Authorization to Customer Support
        5. Summary
      4. Chapter 28: Securing RESTful Web Services with OAuth
        1. Understanding Web Service Security
        2. Introducing OAuth
        3. Using Spring Security OAuth
        4. Finishing the Customer Support Application
        5. Creating an OAuth Client Application
        6. Summary
    5. Introduction
    6. Advertisements
    7. End User License Agreement