Professional Java for Web Applications - Nicholas S. Williams - ebook

Professional Java for Web Applications ebook

Nicholas S. Williams

0,0
179,99 zł

Opis

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.

Ebooka przeczytasz w aplikacjach Legimi na:

Androidzie
iOS
czytnikach certyfikowanych
przez Legimi
Windows
10
Windows
Phone

Liczba stron: 1514




Contents

Part I: Creating Enterprise Applications

Chapter 1: Introducing Java Platform, Enterprise Edition

A Timeline of Java Platforms

Understanding the Basic Web Application Structure

Summary

Chapter 2: Using Web Containers

Choosing a Web Container

Installing Tomcat on Your Machine

Deploying and Undeploying Applications in Tomcat

Debugging Tomcat from Your IDE

Summary

Chapter 3: Writing Your First Servlet

Creating a Servlet Class

Configuring a Servlet for Deployment

Understanding doGet(), doPost(), and Other Methods

Using Parameters and Accepting Form Submissions

Configuring your Application Using Init Parameters

Uploading Files from a Form

Making Your Application Safe for Multithreading

Summary

Chapter 4: Using JSPs to Display Content

<br /> Is Easier Than output.println(“<br />”)

Creating Your First JSP

Using Java within a JSP (and Why You Shouldn’t!)

Combining Servlets and JSPs

A Note about JSP Documents (JSPX)

Summary

Chapter 5: Maintaining State Using Sessions

Understanding Why Sessions Are Necessary

Using Session Cookies and URL Rewriting

Storing Data in a Session

Applying Sessions Usefully

Clustering an Application That Uses Sessions

Summary

Chapter 6: Using the Expression Language in JSPs

Understanding Expression Language

Writing with the EL Syntax

Using Scoped Variables in EL Expressions

Accessing Collections with the Stream API

Replacing Java Code with Expression Language

Summary

Chapter 7: Using the Java Standard Tag Library

Introducing JSP Tags and the JSTL

Using the Core Tag Library (C Namespace)

Using the Internationalization and Formatting Tag Library (FMT Namespace)

Using the Database Access Tag Library (SQL Namespace)

Using the XML Processing Tag Library (X Namespace)

Replacing Java Code with JSP Tags

Summary

Chapter 8: Writing Custom Tag and Function Libraries

Understanding TLDs, Tag Files, and Tag Handlers

Creating Your First Tag File to Serve as an HTML Template

Creating a More Useful Date Formatting Tag Handler

Creating an EL Function to Abbreviate Strings

Replacing Java Code with Custom JSP Tags

Summary

Chapter 9: Improving Your Application Using Filters

Understanding the Purpose of Filters

Creating, Declaring, and Mapping Filters

Ordering Your Filters Properly

Investigating Practical Uses for Filters

Simplifying Authentication with a Filter

Summary

Chapter 10: Making Your Application Interactive with WebSockets

Evolution: From Ajax to WebSockets

Understanding the WebSocket APIs

Creating Multiplayer Games with WebSockets

Using WebSockets to Communicate in a Cluster

Adding “Chat with Support” to the Customer Support Application

Summary

Chapter 11: Using Logging to Monitor Your Application

Understanding the Concepts of Logging

Using Logging Levels and Categories

Choosing a Logging Framework

Integrating Logging into Your Application

Summary

Part II: Adding Spring Framework Into the Mix

Chapter 12: Introducing Spring Framework

What Is Spring Framework?

Why Spring Framework?

Understanding Application Contexts

Bootstrapping Spring Framework

Configuring Spring Framework

Utilizing Bean Definition Profiles

Summary

Chapter 13: Replacing Your Servlets with Controllers

Understanding @RequestMapping

Using Spring Framework’s Model and View Pattern

Making Your Life Easier with Form Objects

Updating the Customer Support Application

Summary

Chapter 14: Using Services and Repositories to Support Your Controllers

Understanding Model-View-Controller Plus Controller-Service-Repository

Using the Root Application Context Instead of a Web Application Context

Improving Services with Asynchronous and Scheduled Execution

Applying Logic Layer Separation to WebSockets

Summary

Chapter 15: Internationalizing Your Application with Spring Framework i18n

Why Do You Need Spring Framework i18n?

Using the Basic Internationalization and Localization APIs

Configuring Internationalization in Spring Framework

Internationalizing Your Code

Summary

Chapter 16: Using JSR 349, Spring Framework, and Hibernate Validator for Bean Validation

What Is Bean Validation?

Configuring Validation in the Spring Framework Container

Adding Constraint Validation Annotations to Your Beans

Configuring Spring Beans for Method Validation

Writing Your Own Validation Constraints

Integrating Validation in the Customer Support Application

Summary

Chapter 17: Creating RESTful and SOAP Web Services

Understanding Web Services

Configuring RESTful Web Services with Spring MVC

Testing Your Web Service Endpoints

Using Spring Web Services for SOAP

Summary

Chapter 18: Using Messaging and Clustering for Flexibility and Reliability

Recognizing When You Need Messaging and Clustering

Adding Messaging Support to your Application

Making your Messaging Distributable Across a Cluster

Distributing Events with AMQP

Summary

Part III: Persisting Data with JPA and Hibernate ORM

Chapter 19: Introducing Java Persistence API and Hibernate ORM

What Is Data Persistence?

What Is an Object-Relational Mapper?

A Brief Look at Hibernate ORM

Preparing a Relational Database

A Note About Maven Dependencies

Summary

Chapter 20: Mapping Entities to Tables with JPA Annotations

Getting Started with Simple Entities

Creating and Using a Persistence Unit

Mapping Complex Data Types

Summary

Chapter 21: Using JPA in Spring Framework Repositories

Using Spring Repositories and Transactions

Configuring Persistence in Spring Framework

Creating and Using JPA Repositories

Converting data with DTOs and Entities

Summary

Chapter 22: Eliminating Boilerplate Repositories with Spring Data JPA

Understanding Spring Data’s Unified Data Access

Configuring and Creating Spring Data JPA Repositories

Refactoring the Customer Support Application

Summary

Chapter 23: Searching for Data with JPA and Hibernate Search

An Introduction to Searching

Using Advanced Criteria to Locate Objects

Taking Advantage of Full-Text Indexes with JPA

Indexing Any Data with Apache Lucene and Hibernate Search

Summary

Chapter 24: Creating Advanced Mappings and Custom Data Types

What’s Left?

Converting Nonstandard Data Types

Embedding POJOs within Entities

Defining Relationships between Entities

Addressing Other Common Situations

Creating Programmatic Triggers

Refining the Customer Support Application

Summary

Part IV: Securing Your Application with Spring Security

Chapter 25: Introducing Spring Security

What Is Authentication?

Why Spring Security?

Summary

Chapter 26: Authenticating Users with Spring Security

Choosing and Configuring an Authentication Provider

Writing Your Own Authentication Provider

Summary

Chapter 27: Using Authorization Tags and Annotations

Authorizing by Declaration

Understanding Authorization Decisions

Creating Access Control Lists for Object Security

Adding Authorization to Customer Support

Summary

Chapter 28: Securing RESTful Web Services with OAuth

Understanding Web Service Security

Introducing OAuth

Using Spring Security OAuth

Finishing the Customer Support Application

Creating an OAuth Client Application

Summary

Introduction

Advertisements

End User License Agreement

List of Illustrations

FIGURE 1-1: A timeline showing the correlation of the evolution of Java Platform, Standard Edition and Java Platform, Enterprise Edition. The events on top of the timeline represent Java SE milestones while the events on the bottom represent Java EE milestones.

FIGURE 1-2

FIGURE 1-3

FIGURE 2-1

FIGURE 2-2

FIGURE 2-3

FIGURE 2-4

FIGURE 2-5

FIGURE 2-6

FIGURE 2-7

FIGURE 2-8

FIGURE 2-9

FIGURE 2-10

FIGURE 2-11

FIGURE 2-12

FIGURE 2-13

FIGURE 3-1

FIGURE 3-2

FIGURE 4-1

FIGURE 4-2

FIGURE 5-1

FIGURE 5-2

FIGURE 5-3

FIGURE 5-4

FIGURE 5-5

FIGURE 6-1

FIGURE 7-1

FIGURE 7-2

FIGURE 9-1

FIGURE 9-2

FIGURE 9-3

FIGURE 9-4

FIGURE 10-1

FIGURE 10-2

FIGURE 10-3

FIGURE 10-4

FIGURE 10-5

FIGURE 10-6

FIGURE 10-7

FIGURE 12-1

FIGURE 13-1

FIGURE 14-1

FIGURE 14-2

FIGURE 16-1

FIGURE 16-2

FIGURE 17-1

FIGURE 17-2

FIGURE 17-3

FIGURE 18-1

FIGURE 18-2

FIGURE 18-3

FIGURE 18-4

FIGURE 18-5

FIGURE 18-6

FIGURE 19-1

FIGURE 19-2

FIGURE 20-1

FIGURE 22-1

FIGURE 22-2

FIGURE 23-1

FIGURE 25-1

FIGURE 25-2

FIGURE 28-1

FIGURE 28-2

FIGURE 28-3

FIGURE 28-4

FIGURE 28-5

FIGURE 28-6

FIGURE 28-7

List of Tables

TABLE 2-1: Tomcat Versions and Their Specifications

TABLE 2-2: Container and Application Server Versions

TABLE 3.1: Empty Implementations for HTTP Method Types

TABLE 4.1: Comparison of JSP Features and JSP Document Features

TABLE 11.1: Common Logging Levels

TABLE 11.2: Inheritance Hierarchy for Log4j 2 Loggers

TABLE 21-1: Common Hibernate Dialects

Pages

i

ii

iii

iv

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!